Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
glass-ships committed Mar 27, 2024
1 parent c2dfd51 commit cbabe69
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/unit/pombase/test_pombase_gene.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,27 @@ def gene_information_entities(mock_koza, taxon_label_map_cache, global_table):
global_table=global_table,
)

@pytest.fixture
def gene_entity_no_name(mock_koza, taxon_label_map_cache, global_table):
row = {
'gene_systematic_id': 'SPAC1002.06c',
'gene_systematic_id_with_prefix': 'POMBASE:SPAC1002.06c',
'gene_name': '',
'chromosome_id': 'chromosome_1',
'gene_product': 'bouquet formation protein Bqt2',
'uniprot_id': 'Q9US52',
'gene type': 'protein coding gene',
'synonyms': 'mug18,rec23',
}

return mock_koza(
"pombase_gene",
iter([row]),
"./src/monarch_ingest/ingests/pombase/gene.py",
map_cache=taxon_label_map_cache,
global_table=global_table,
)


def test_gene_information_gene(gene_information_entities):
assert len(gene_information_entities) == 1
Expand All @@ -43,3 +64,9 @@ def test_gene_information_id(gene_information_entities):
def test_gene_xref(gene_information_entities):
gene = gene_information_entities[0]
assert "UniProtKB:Q9US52" in gene.xref

def test_gene_systematic_id_as_name(gene_entity_no_name):
gene = gene_entity_no_name[0]
assert gene.name == "SPAC1002.06c"
assert gene.full_name == "SPAC1002.06c"
assert gene.symbol == "SPAC1002.06c"

0 comments on commit cbabe69

Please sign in to comment.