Skip to content

Commit

Permalink
Merge pull request #274 from Knowledge-Graph-Hub/add_test_for_gpi_file
Browse files Browse the repository at this point in the history
Add some sanity checking for GPI file (parsability, gene count)
  • Loading branch information
justaddcoffee committed Jul 7, 2020
2 parents 1e65af7 + 394d08e commit c724469
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_gpi_file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import os
import unittest

from kg_covid_19.transform_utils.sars_cov_2_gene_annot.sars_cov_2_gene_annot import \
_gpi12iterator


class TestGpiFile(unittest.TestCase):
def setUp(self) -> None:
self.gpi_file = 'curated/ORFs/uniprot_sars-cov-2.gpi'
self.expected_sars_cov2_genes = 32

def test_gpi_file_exists(self):
self.assertTrue(os.path.exists(self.gpi_file))

def test_gpi_parsing(self):
count: int = 0
with open(self.gpi_file, 'r') as gpi_fh:
for rec in _gpi12iterator(gpi_fh):
count += 1
self.assertEqual(self.expected_sars_cov2_genes, count)

0 comments on commit c724469

Please sign in to comment.