Skip to content

Commit

Permalink
ilx add_entity fix drop key vs null bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tgbugs committed Mar 29, 2019
1 parent 4164aea commit 061fc3d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ontquery/plugins/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@ def add_entity(self, type, subThingOf, label, definition: str=None,
labels=tuple(),
#abbrev=None, # TODO
#acronym=None, # TODO
definition=resp['definition'],
synonyms=tuple(resp['synonyms']),
definition=resp.get('definition', None),
synonyms=tuple(resp.get('synonyms', tuple())),
#deprecated=None,
#prefix=None,
#category=None,
Expand Down
9 changes: 8 additions & 1 deletion test/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,18 @@ def test_zz_add_entity(self): # needs zz so that it runs after setup()
# NOTE the values in the response are a mishmash of garbage because
# the tmp_ ids were never properly abstracted

if 'CI' not in os.environ: # production doesn't have all the required features yet
def test_add_pde(self):
qr = self.remote.add_pde(f'test pde {uuid4()}')
print(qr)


if 'CI' not in os.environ: # production uri resolver doesn't have all the required features yet
beta = 'https://beta.scicrunch.org/api/1/'
class TestIlx(_TestIlx, unittest.TestCase):
remote = oq.plugin.get('InterLex')(apiEndpoint=beta,
host='localhost', port='8505')
remote.setup() # have to call this manually since the service is not fed to queries
# NOTE this is probably overengineered ...


class TestSciGraph(ServiceBase, unittest.TestCase):
Expand Down

0 comments on commit 061fc3d

Please sign in to comment.