Пример #1
0
    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"
        ])
Пример #2
0
    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"
        ])
Пример #3
0
 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)
Пример #4
0
 def test_raises_not_find_online(self):
     with pytest.raises(ValueError):
         nomenclature.BW_finder("B2AR", )
Пример #5
0
 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)
Пример #6
0
 def test_raises_not_find_locally(self):
     with pytest.raises(FileNotFoundError):
         nomenclature.BW_finder("B2AR", try_web_lookup=False)