Skip to content

Commit

Permalink
added waits so metadata is populated before we test
Browse files Browse the repository at this point in the history
see notes in code
  • Loading branch information
zcqian committed Aug 19, 2021
1 parent 5358992 commit c714d31
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/tests/app/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,29 @@ def test_redir_not(self):
class TestLicenseXfrm(BiothingsWebAppTest):
TEST_DATA_DIR_NAME = 'mv_app_test'

def _wait(self):
# seems like the only way to do it
# although this is not its (AsyncTestCase.wait) intended use
# (besides actually fixing the issue so that web blocks until metadata is ready)
#
# Note: don't try to put it in a fixture, it won't work
try:
self.wait(timeout=3.0)
except: # noqa
pass

def test_exac_nontcga(self):
self._wait()
res = self.request('variant', data={'id': 'chr8:g.7194707G>A'})
assert '_license' in res.json()['exac_nontcga']

def test_gnomad_exome(self):
self._wait()
res = self.request('variant', data={'id': 'chr8:g.7194707G>A'})
assert '_license' in res.json()['gnomad_exome']

def test_gnomad_genome(self):
self._wait()
res = self.request('variant', data={'id': 'chr8:g.7194707G>A'})
assert '_license' in res.json()['gnomad_genome']

Expand Down

0 comments on commit c714d31

Please sign in to comment.