Skip to content

Commit b61a438

Browse files
committed
update tests for pdb fetcher
1 parent 8778a85 commit b61a438

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/integration/test_fetcher.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import pytest
22
from pyenzyme.fetcher.chebi import fetch_chebi
3+
from pyenzyme.fetcher.pdb import fetch_pdb
34
from pyenzyme.fetcher.pubchem import fetch_pubchem
45
from pyenzyme.fetcher.rhea import fetch_rhea
56
from pyenzyme.fetcher.uniprot import fetch_uniprot
@@ -116,3 +117,20 @@ def test_fetch_pubchem_to_small_molecule(self):
116117
def test_fetch_pubchem_to_small_molecule_invalid_id(self):
117118
with pytest.raises(ValueError):
118119
fetch_pubchem(cid=162176127617627)
120+
121+
def test_fetch_pdb_to_protein(self):
122+
protein = fetch_pdb("1a23")
123+
assert protein is not None
124+
assert protein.id == "1a23_1"
125+
assert (
126+
protein.name
127+
== "SOLUTION NMR STRUCTURE OF REDUCED DSBA FROM ESCHERICHIA COLI, MINIMIZED AVERAGE STRUCTURE"
128+
)
129+
assert (
130+
protein.sequence
131+
== "AQYEDGKQYTTLEKPVAGAPQVLEFFSFFCPHCYQFEEVLHISDNVKKKLPEGVKMTKYHVNFMGGDLGKDLTQAWAVAMALGVEDKVTVPLFEGVQKTQTIRSASDIRDVFINAGIKGEEYDAAWNSFVVKSLVAQQEKAAADVQLRGVPAMFVNGKYQLNPQGMDTSNMDVFVQQYADTVKYLSEKK"
132+
)
133+
134+
def test_fetch_pdb_to_protein_invalid_id(self):
135+
with pytest.raises(ValueError):
136+
fetch_pdb("INVALID_ID")

0 commit comments

Comments
 (0)