Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mutalyzer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirrors
mutalyzer
Commits
15dcda64
Commit
15dcda64
authored
9 years ago
by
Vermaat
Browse files
Options
Downloads
Patches
Plain Diff
Links in standalone mode should retain this mode
Fixes #287
parent
f3b05bc6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mutalyzer/website/templates/name-checker.html
+2
-2
2 additions, 2 deletions
mutalyzer/website/templates/name-checker.html
tests/test_website.py
+35
-2
35 additions, 2 deletions
tests/test_website.py
with
37 additions
and
4 deletions
mutalyzer/website/templates/name-checker.html
+
2
−
2
View file @
15dcda64
...
...
@@ -124,7 +124,7 @@
<h4>
Description relative to transcription start
</h4>
<p>
(Not for use in LSDBs in case of protein-coding transcripts).
</p>
{% endif %}
<p><code><a
href=
"{{ url_for('.name_checker', description=genomicDescription) }}"
>
{{ genomicDescription }}
</a></code></p>
<p><code><a
href=
"{{ url_for('.name_checker', description=genomicDescription
, standalone=standalone|int or None
) }}"
>
{{ genomicDescription }}
</a></code></p>
{% endif %}
{% if chromDescription %}
...
...
@@ -138,7 +138,7 @@
{% if i.endswith('?') %}
<p><code>
{{ i }}
</code></p>
{% else %}
<p><code><a
href=
"{{ url_for('.name_checker', description=i) }}"
>
{{ i }}
</a></code></p>
<p><code><a
href=
"{{ url_for('.name_checker', description=i
, standalone=standalone|int or None
) }}"
>
{{ i }}
</a></code></p>
{% endif %}
{% endfor %}
{% endif %}
...
...
This diff is collapsed.
Click to expand it.
tests/test_website.py
+
35
−
2
View file @
15dcda64
...
...
@@ -9,6 +9,8 @@ import bz2
from
mock
import
patch
import
os
from
io
import
BytesIO
import
re
import
urlparse
from
Bio
import
Entrez
import
lxml.html
...
...
@@ -24,6 +26,19 @@ from fixtures import with_references
# TODO: Tests for /upload.
def
get_links
(
data
,
path
=
None
):
"""
Extract all link targets, or only those targeting the specified path, from
the page and parse them.
"""
def
parse_link
(
link
):
splitted
=
urlparse
.
urlsplit
(
link
)
return
splitted
.
path
,
urlparse
.
parse_qs
(
splitted
.
query
)
links
=
[
parse_link
(
link
)
for
link
in
re
.
findall
(
'
href=
"
([^
"
]+)
"'
,
data
)]
return
[(
p
,
q
)
for
p
,
q
in
links
if
path
is
None
or
p
==
path
]
@pytest.fixture
def
website
():
return
create_app
().
test_client
()
...
...
@@ -301,6 +316,22 @@ def test_check_noninteractive(website):
assert
'
Raw variant 1: deletion of 1
'
in
r
.
data
@with_references
(
'
NG_012772.1
'
)
def
test_check_noninteractive_links
(
website
):
"""
Submitting non-interactively should have links to transcripts also
non-interactive.
"""
r
=
website
.
get
(
'
/name-checker
'
,
query_string
=
{
'
description
'
:
'
NG_012772.1:g.128del
'
,
'
standalone
'
:
'
1
'
})
assert
'
0 Errors
'
in
r
.
data
links
=
get_links
(
r
.
data
,
path
=
'
/name-checker
'
)
assert
len
(
links
)
>=
2
assert
all
(
q
[
'
standalone
'
]
==
[
'
1
'
]
for
_
,
q
in
links
)
@with_references
(
'
NG_012772.1
'
)
def
test_check_interactive_links
(
website
):
"""
...
...
@@ -310,8 +341,10 @@ def test_check_interactive_links(website):
r
=
website
.
get
(
'
/name-checker
'
,
query_string
=
{
'
description
'
:
'
NG_012772.1:g.128del
'
})
assert
'
0 Errors
'
in
r
.
data
assert
'
href=
"
/name-checker?description=NG_012772.1%3Ag.128del
"'
in
r
.
data
assert
'
href=
"
/name-checker?description=NG_012772.1%28BRCA2_v001%29%3Ac.-5100del
"'
in
r
.
data
links
=
get_links
(
r
.
data
,
path
=
'
/name-checker
'
)
assert
len
(
links
)
>=
2
assert
all
(
'
standalone
'
not
in
q
for
_
,
q
in
links
)
def
test_snp_converter_valid
(
website
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment