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
45f7d276
Commit
45f7d276
authored
9 years ago
by
Vermaat
Browse files
Options
Downloads
Patches
Plain Diff
Test querying transcript-protein links
parent
ba859618
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_db_queries.py
+67
-0
67 additions, 0 deletions
tests/test_db_queries.py
with
67 additions
and
0 deletions
tests/test_db_queries.py
0 → 100644
+
67
−
0
View file @
45f7d276
"""
Tests for the mutalyzer.db.queries module.
"""
from
__future__
import
unicode_literals
#import logging; logging.basicConfig()
from
mutalyzer.db
import
queries
from
fixtures
import
database
,
cache
from
utils
import
MutalyzerTest
from
utils
import
fix
class
TestMutator
(
MutalyzerTest
):
"""
Test the queries module.
"""
fixtures
=
(
database
,
)
def
setup
(
self
):
super
(
TestMutator
,
self
).
setup
()
@fix
(
cache
(
'
MARK1
'
))
def
test_get_transcript_protein_link
(
self
):
"""
Query a transcript-protein link by transcript.
"""
link
=
queries
.
get_transcript_protein_link
(
'
NM_018650
'
)
assert
link
.
transcript_accession
==
'
NM_018650
'
assert
link
.
protein_accession
==
'
NP_061120
'
@fix
(
cache
(
'
MARK1
'
))
def
test_get_transcript_protein_link_negative
(
self
):
"""
Query a negative transcript-protein link by transcript.
"""
link
=
queries
.
get_transcript_protein_link
(
'
XM_005273133
'
)
assert
link
.
transcript_accession
==
'
XM_005273133
'
assert
link
.
protein_accession
is
None
@fix
(
cache
(
'
MARK1
'
))
def
test_get_transcript_protein_link_missing
(
self
):
"""
Query a missing transcript-protein link by transcript.
"""
link
=
queries
.
get_transcript_protein_link
(
'
NM_123456
'
)
assert
link
is
None
@fix
(
cache
(
'
MARK1
'
))
def
test_get_transcript_protein_link_reverse
(
self
):
"""
Query a transcript-protein link by protein.
"""
link
=
queries
.
get_transcript_protein_link
(
'
NP_061120
'
,
reverse
=
True
)
assert
link
.
transcript_accession
==
'
NM_018650
'
assert
link
.
protein_accession
==
'
NP_061120
'
@fix
(
cache
(
'
MARK1
'
))
def
test_get_transcript_protein_link_reverse_missing
(
self
):
"""
Query a missing transcript-protein link by protein.
"""
link
=
queries
.
get_transcript_protein_link
(
'
NP_123456
'
)
assert
link
is
None
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