66from pyenzyme .fetcher .pubchem import fetch_pubchem
77from pyenzyme .fetcher .rhea import fetch_rhea
88from pyenzyme .fetcher .uniprot import fetch_uniprot
9+ from tests .utils import skip_on_forbidden
910
1011
1112class TestFetcher :
1213 @pytest .mark .remote
14+ @skip_on_forbidden
1315 def test_fetch_chebi_to_small_molecule (self ):
1416 small_molecule = fetch_chebi ("CHEBI:15377" )
1517 assert small_molecule is not None
@@ -26,6 +28,7 @@ def test_fetch_chebi_to_small_molecule(self):
2628 )
2729
2830 @pytest .mark .remote
31+ @skip_on_forbidden
2932 def test_fetch_chebi_to_small_molecule_with_id (self ):
3033 small_molecule = fetch_chebi ("CHEBI:15377" , smallmol_id = "s1" )
3134 assert small_molecule is not None
@@ -42,11 +45,13 @@ def test_fetch_chebi_to_small_molecule_with_id(self):
4245 )
4346
4447 @pytest .mark .remote
48+ @skip_on_forbidden
4549 def test_fetch_chebi_to_small_molecule_invalid_id (self ):
4650 with pytest .raises (ValueError ):
4751 fetch_chebi ("INVALID_ID" )
4852
4953 @pytest .mark .remote
54+ @skip_on_forbidden
5055 def test_fetch_uniprot_to_protein (self ):
5156 protein = fetch_uniprot ("P07327" )
5257 assert protein is not None
@@ -64,6 +69,7 @@ def test_fetch_uniprot_to_protein(self):
6469 assert protein .references [0 ] == "https://www.uniprot.org/uniprotkb/P07327"
6570
6671 @pytest .mark .remote
72+ @skip_on_forbidden
6773 def test_fetch_uniprot_to_protein_with_prefix (self ):
6874 protein = fetch_uniprot ("uniprot:P07327" )
6975 assert protein is not None
@@ -81,6 +87,7 @@ def test_fetch_uniprot_to_protein_with_prefix(self):
8187 assert protein .references [0 ] == "https://www.uniprot.org/uniprotkb/P07327"
8288
8389 @pytest .mark .remote
90+ @skip_on_forbidden
8491 def test_fetch_uniprot_to_protein_with_id (self ):
8592 protein = fetch_uniprot ("P07327" , protein_id = "p1" )
8693 assert protein is not None
@@ -98,6 +105,7 @@ def test_fetch_uniprot_to_protein_with_id(self):
98105 assert protein .references [0 ] == "https://www.uniprot.org/uniprotkb/P07327"
99106
100107 @pytest .mark .remote
108+ @skip_on_forbidden
101109 def test_fetch_rhea_to_reaction (self ):
102110 reaction , small_molecules = fetch_rhea ("RHEA:22864" )
103111
@@ -124,11 +132,13 @@ def test_fetch_rhea_to_reaction(self):
124132 assert reaction .products [0 ].species_id == small_molecules [0 ].id
125133
126134 @pytest .mark .remote
135+ @skip_on_forbidden
127136 def test_fetch_rhea_to_reaction_invalid_id (self ):
128137 with pytest .raises (ValueError ):
129138 fetch_rhea ("INVALID_ID" )
130139
131140 @pytest .mark .remote
141+ @skip_on_forbidden
132142 def test_fetch_pubchem_to_small_molecule (self ):
133143 small_molecule = fetch_pubchem (cid = "2244" )
134144 assert small_molecule is not None
@@ -142,6 +152,7 @@ def test_fetch_pubchem_to_small_molecule(self):
142152 )
143153
144154 @pytest .mark .remote
155+ @skip_on_forbidden
145156 def test_fetch_pubchem_to_small_molecule_with_prefix (self ):
146157 small_molecule = fetch_pubchem (cid = "pubchem:2244" )
147158 assert small_molecule is not None
@@ -155,11 +166,13 @@ def test_fetch_pubchem_to_small_molecule_with_prefix(self):
155166 )
156167
157168 @pytest .mark .remote
169+ @skip_on_forbidden
158170 def test_fetch_pubchem_to_small_molecule_invalid_id (self ):
159171 with pytest .raises (httpx .HTTPStatusError ):
160172 fetch_pubchem (cid = "162176127617627" )
161173
162174 @pytest .mark .remote
175+ @skip_on_forbidden
163176 def test_fetch_pdb_to_protein (self ):
164177 protein = fetch_pdb ("1a23" )
165178 assert protein is not None
@@ -174,6 +187,7 @@ def test_fetch_pdb_to_protein(self):
174187 )
175188
176189 @pytest .mark .remote
190+ @skip_on_forbidden
177191 def test_fetch_pdb_to_protein_with_prefix (self ):
178192 protein = fetch_pdb ("pdb:1a23" )
179193 assert protein is not None
@@ -188,6 +202,7 @@ def test_fetch_pdb_to_protein_with_prefix(self):
188202 )
189203
190204 @pytest .mark .remote
205+ @skip_on_forbidden
191206 def test_fetch_pdb_to_protein_invalid_id (self ):
192207 with pytest .raises (ValueError ):
193208 fetch_pdb ("INVALID_ID" )
0 commit comments