Skip to content

Commit

Permalink
Fix failing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
davmlaw committed Aug 19, 2024
1 parent 1338026 commit 7ef4906
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions variantopedia/tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ def setUpTestData(cls):

create_fake_transcript_version(GenomeBuild.grch38())

def _verify_all_of_type(self, search_results, search_type):
def _verify_all_of_type(self, search_results, search_type, ignore_errors=False):
for sr in search_results.results:
if ignore_errors:
if sr.preview.is_error:
continue
self.assertEqual(search_type, sr.search_type, f"Search result {sr} is of type {search_type}")

def test_search_hgvs(self):
Expand All @@ -32,7 +35,8 @@ def test_search_hgvs(self):
]
for hgvs_name in HGVS_NAMES:
search_results = search_data(self.user, hgvs_name, False)
self._verify_all_of_type(search_results, SearchTypes.VARIANT)
# Need to ignore errors as 37 HGVS uses fake clingen
self._verify_all_of_type(search_results, SearchTypes.VARIANT, ignore_errors=True)

def test_search_gene_hgvs(self):
HGVS_NAMES = [
Expand Down

0 comments on commit 7ef4906

Please sign in to comment.