def test_works_online(self): df, filename = nomenclature.BW_finder("adrb2_human", ) assert isinstance(df, DataFrame) assert isinstance(filename, str) assert "http" in filename _np.testing.assert_array_equal(list(df.keys()), [ "protein_segment", "AAresSeq", "BW", "GPCRdb(A)", "display_generic_number" ])
def test_works_locally(self): df, filename = nomenclature.BW_finder( test_filenames.GPCRmd_B2AR_nomenclature_test_xlsx, try_web_lookup=False, ) assert isinstance(df, DataFrame) assert isinstance(filename, str) _np.testing.assert_array_equal(list(df.keys()), [ "protein_segment", "AAresSeq", "BW", "GPCRdb(A)", "display_generic_number" ])
def test_not_find_online_but_no_raise(self): df, filename = nomenclature.BW_finder("3SNw", dont_fail=True) assert df is None assert isinstance(filename, str)
def test_raises_not_find_online(self): with pytest.raises(ValueError): nomenclature.BW_finder("B2AR", )
def test_not_find_locally_but_no_fail(self): DF, filename = nomenclature.BW_finder("B2AR", try_web_lookup=False, dont_fail=True) assert DF is None assert isinstance(filename, str)
def test_raises_not_find_locally(self): with pytest.raises(FileNotFoundError): nomenclature.BW_finder("B2AR", try_web_lookup=False)