Commit dff4e9c0 authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

raise notimplementederror for source with no API

parent 25fc8112
......@@ -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:
......
......@@ -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))
return {}
raise NotImplementedError
def _get_kegg(self):
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment