Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SOaAS
dbxref
Commits
6bb1c8a1
Commit
6bb1c8a1
authored
Apr 09, 2018
by
Lukas Jelonek
Browse files
Fix bug: Entry without comments causes exceptions
parent
563015e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
dbxref/retrieve/pfam.py
View file @
6bb1c8a1
...
...
@@ -71,9 +71,13 @@ def read_annotation(entry):
annotation
=
{
'domain'
:
entry
.
attrib
[
'id'
],
'accession'
:
entry
.
attrib
[
'accession'
],
'terms'
:
[],
'comment'
:
entry
.
find
(
'pfam:comment'
,
ns
).
text
.
strip
()
'terms'
:
[]
}
comment
=
entry
.
find
(
'pfam:comment'
,
ns
)
if
comment
:
annotation
[
'comment'
]
=
comment
.
text
.
strip
()
go_terms
=
entry
.
find
(
'pfam:go_terms'
,
ns
)
if
go_terms
:
categories
=
go_terms
.
findall
(
'pfam:category'
,
ns
)
...
...
tests/test_pfam.py
View file @
6bb1c8a1
import
unittest
from
dbxref
import
retriever
,
resolver
from
dbxref
.retrieve
import
pfam
class
TestPfam
(
unittest
.
TestCase
):
def
test_no_
go_terms
(
self
):
'''regression test for missing
go terms
in pfam entry'''
documents
=
retriever
.
retrieve
([{
'db'
:
'
pfam
'
,
'id'
:
'PF
10423.8
'
}])
def
test_no_
position
(
self
):
'''regression test for missing
comment
in pfam entry'''
documents
=
pfam
.
retrieve
([{
'db'
:
'
PFAM
'
,
'id'
:
'PF
00083.23
'
}])
# this test failed due to an error due to missing None handling,
# so no assertions here. Once fixed. this should suffice
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment