Skip to content

Commit

Permalink
group tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry committed Jul 18, 2021
1 parent ee9e9c7 commit 6357d51
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 20 deletions.
Empty file removed src/tests/__init__.py
Empty file.
1 change: 1 addition & 0 deletions src/tests/app/ZC_TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LOCAL APP TESTS GO HERE
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
MyVariant Data-Aware Tests
'''

from biothings.tests.web import BiothingsTestCase
from biothings.tests.web import BiothingsWebTest


class TestMyvariant(BiothingsTestCase):
class TestMyvariant(BiothingsWebTest):
host = "myvariant.info"

# override
def query(self, *args, **kwargs):
Expand Down
17 changes: 7 additions & 10 deletions src/tests/test_others.py → src/tests/data/test_others.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
'''
MyVariant Data-Aware Tests
'''
import os
import time

from pprint import pformat

from biothings.tests.web import BiothingsTestCase
from biothings.tests.web import BiothingsWebTest


class TestMyvariant(BiothingsTestCase):
class TestMyvariant(BiothingsWebTest):
host = "myvariant.info"

def check_index_count(self, assembly):
# when run individually
Expand All @@ -18,7 +15,7 @@ def check_index_count(self, assembly):
meta = self.request(f"{assembly}/metadata").json()
results = {}
for src_name in meta["src"]:
#if src_name == "cadd":
# if src_name == "cadd":
# continue
if src_name == "snpeff":
continue # not a root src, counts always different
Expand All @@ -30,7 +27,8 @@ def check_index_count(self, assembly):
subsrc = subsrc.rstrip("s") # plural in meta, singular in docs
meta_cnt = meta["src"][src_name]["stats"][stat]
try:
res = self.request("query?q=_exists_:%s&size=0&assembly=%s" % (subsrc, assembly)).json()
res = self.request("query?q=_exists_:%s&size=0&assembly=%s" %
(subsrc, assembly)).json()
except:
print(f'Query error for ("{subsrc}", "{assembly}")')
raise
Expand All @@ -45,7 +43,6 @@ def check_index_count(self, assembly):
errs[src]["diff"] = mc - ic
assert len(errs) == 0, "Some counts don't match metadata:\n%s" % pformat(errs)


def test_300_metadata(self):
self.request("metadata").content

Expand Down
13 changes: 5 additions & 8 deletions src/tests/test_query.py → src/tests/data/test_query.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
'''
MyVariant Data-Aware Tests
'''
import os
from pprint import pformat

from biothings.tests.web import BiothingsTestCase
from biothings.tests.web import BiothingsWebTest


class TestMyvariant(BiothingsTestCase):
class TestMyvariant(BiothingsWebTest):
host = "myvariant.info"

# override
def query(self, *args, **kwargs):
Expand Down Expand Up @@ -66,7 +62,8 @@ def test_129_query(self):
self.query(q='snpeff.ann.genename:BTK', morethan=8000)

def test_130_query(self):
self.query(q='_exists_:wellderly AND cadd.polyphen.cat:possibly_damaging', fields='wellderly,cadd.polyphen')
self.query(q='_exists_:wellderly AND cadd.polyphen.cat:possibly_damaging',
fields='wellderly,cadd.polyphen')

def test_131_query_jsonld(self):
pass # feature removed in biothings 0.7.0
Expand Down

0 comments on commit 6357d51

Please sign in to comment.