@@ -82,9 +82,7 @@ def test_get_registered_allele_expressions_unpopulated(
8282 if "vcf_expression" not in allele_fixture :
8383 continue
8484 assert (
85- anyvar_client .get_registered_allele_expression (
86- allele_fixture ["vcf_expression" ]
87- )
85+ anyvar_client .get_registered_allele (allele_fixture ["vcf_expression" ])
8886 is None
8987 )
9088
@@ -98,7 +96,7 @@ def test_get_registered_allele_expressions_populated(
9896 for allele_fixture in alleles .values ():
9997 if "vcf_expression" not in allele_fixture :
10098 continue
101- assert anyvar_client .get_registered_allele_expression (
99+ assert anyvar_client .get_registered_allele (
102100 allele_fixture ["vcf_expression" ]
103101 ) == models .Allele (** allele_fixture ["variation" ])
104102
@@ -129,76 +127,3 @@ def test_put_allele_expressions_handle_invalid(
129127 ["Y-2781761-A-C" , allele_fixture ["vcf_expression" ]]
130128 )
131129 assert results == [None , allele_fixture ["variation" ]["id" ]]
132-
133-
134- @pytest .mark .vcr
135- @pytest .mark .parametrize ("anyvar_client" , POPULATED_CLIENTS , indirect = True )
136- def test_search_by_interval (anyvar_client : BaseAnyVarClient , alleles : dict ):
137- """Test `search_by_interval` for a couple of basic cases"""
138- results = anyvar_client .search_by_interval (
139- "ga4gh:SQ.8_liLu1aycC0tPQPFmUaGXJLDs5SbPZ5" , 2781760 , 2781760
140- )
141- assert sorted (results , key = lambda r : r .id ) == [
142- models .Allele (
143- ** alleles ["ga4gh:VA.9VDxL0stMBOZwcTKw3yb3UoWQkpaI9OD" ]["variation" ]
144- ),
145- models .Allele (
146- ** alleles ["ga4gh:VA.R4kbmdsn5VldGrBiAaByO5N9zM3qCSFw" ]["variation" ]
147- ),
148- ]
149- results = anyvar_client .search_by_interval (
150- "ga4gh:SQ.8_liLu1aycC0tPQPFmUaGXJLDs5SbPZ5" , 2781760 , 2781768
151- )
152- assert sorted (results , key = lambda r : r .id ) == [
153- models .Allele (
154- ** alleles ["ga4gh:VA.9VDxL0stMBOZwcTKw3yb3UoWQkpaI9OD" ]["variation" ]
155- ),
156- models .Allele (
157- ** alleles ["ga4gh:VA.R4kbmdsn5VldGrBiAaByO5N9zM3qCSFw" ]["variation" ]
158- ),
159- models .Allele (
160- ** alleles ["ga4gh:VA.yi7A2l0uIUMaInQaJnHU_B2Cf_OuZRJg" ]["variation" ]
161- ),
162- ]
163-
164-
165- @pytest .mark .vcr
166- @pytest .mark .parametrize ("anyvar_client" , POPULATED_CLIENTS , indirect = True )
167- def test_search_by_interval_with_alias (anyvar_client : BaseAnyVarClient , alleles : dict ):
168- """Test use of sequence alias"""
169- results = anyvar_client .search_by_interval ("GRCh38.p1:Y" , 2781760 , 2781760 )
170- assert sorted (results , key = lambda r : r .id ) == [
171- models .Allele (
172- ** alleles ["ga4gh:VA.9VDxL0stMBOZwcTKw3yb3UoWQkpaI9OD" ]["variation" ]
173- ),
174- models .Allele (
175- ** alleles ["ga4gh:VA.R4kbmdsn5VldGrBiAaByO5N9zM3qCSFw" ]["variation" ]
176- ),
177- ]
178-
179-
180- @pytest .mark .vcr
181- @pytest .mark .parametrize ("anyvar_client" , POPULATED_CLIENTS , indirect = True )
182- def test_search_by_interval_unknown_alias (anyvar_client : BaseAnyVarClient ):
183- """Test handling response when sequence alias isn't recognized."""
184- assert anyvar_client .search_by_interval ("GRCh45.p1:Y" , 2781760 , 2781760 ) == []
185-
186-
187- @pytest .mark .vcr
188- @pytest .mark .parametrize ("anyvar_client" , POPULATED_CLIENTS , indirect = True )
189- def test_search_by_interval_unknown_accession (anyvar_client : BaseAnyVarClient ):
190- """Test handling response when accession ID isn't recognized"""
191- results = anyvar_client .search_by_interval (
192- "ga4gh:SQ.ZZZZZu1aycC0tPQPFmUaGXJLDs5SbPZ5" , 2781760 , 2781768
193- )
194- assert results == []
195-
196-
197- @pytest .mark .vcr
198- @pytest .mark .parametrize ("anyvar_client" , POPULATED_CLIENTS , indirect = True )
199- def test_search_by_interval_not_found (anyvar_client : BaseAnyVarClient ):
200- """Test handling response when no matching variants are found"""
201- results = anyvar_client .search_by_interval (
202- "ga4gh:SQ.8_liLu1aycC0tPQPFmUaGXJLDs5SbPZ5" , 1 , 100
203- )
204- assert results == []
0 commit comments