Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Metagenomics
metagenedb
Commits
dff4e9c0
Commit
dff4e9c0
authored
Nov 19, 2019
by
Kenzo-Hugo Hillion
♻
Browse files
raise notimplementederror for source with no API
parent
25fc8112
Changes
2
Hide whitespace changes
Inline
Side-by-side
backend/metagenedb/common/utils/external_api/test_togows.py
View file @
dff4e9c0
...
...
@@ -9,8 +9,9 @@ from metagenedb.common.utils.external_api.togows import GetFunctionExternalInfo
class
TestGetFunctionExternalInfo
(
TestCase
):
def
test_get_details_unknown_source
(
self
):
external_info_retriever
=
GetFunctionExternalInfo
(
"test_id"
,
"unknown"
)
self
.
assertDictEqual
(
external_info_retriever
.
get_details
(),
{})
with
self
.
assertRaises
(
NotImplementedError
):
external_info_retriever
=
GetFunctionExternalInfo
(
"test_id"
,
"unknown"
)
external_info_retriever
.
get_details
()
def
test_get_details_kegg
(
self
):
with
mock
.
patch
(
'metagenedb.common.utils.external_api.togows.TogoWSEntryAPI'
)
as
MockTogoWSEntryAPI
:
...
...
backend/metagenedb/common/utils/external_api/togows.py
View file @
dff4e9c0
...
...
@@ -16,7 +16,7 @@ class GetFunctionExternalInfo:
def
_get_unknown_source
(
self
):
logger
.
warning
(
"No source of information for %s from %s"
%
(
self
.
function_id
,
self
.
source
))
r
eturn
{}
r
aise
NotImplementedError
def
_get_kegg
(
self
):
"""
...
...
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