def test_get_collections_type(self):
     df = get_collections("Industrial Services",
                          "sector",
                          output_format='pandas')
     assert isinstance(df, pd.DataFrame)
     assert len(df) == 39
     assert len(df.columns) > 500
    def test_get_collections_pandas(self):
        df = get_collections("Restaurants", output_format='pandas')

        assert isinstance(df, pd.DataFrame)

        assert "change" in df.index
        assert "close" in df.index
    def test_get_collections_pandas(self):
        df = get_collections("Computer Hardware", output_format='pandas')

        assert isinstance(df, pd.DataFrame)
        assert len(df) == 39

        assert "change" in df.index
        assert "close" in df.index
    def test_get_collections(self):
        # by tag
        data = get_collections("Restaurants")

        assert isinstance(data, list)
        assert len(data) > 100
    def test_get_collections_no_collection(self):
        with pytest.raises(TypeError):
            get_collections()

        with pytest.raises(ValueError):
            get_collections("Computer Hardware", "badcollection")
Beispiel #6
0
    def test_collections(self):
        data = get_collections("Technology", "sector")

        assert isinstance(data, pd.DataFrame)
        assert "companyName" in data.columns
Beispiel #7
0
    def test_collections_empty_name(self):
        data = get_collections("BADNAME", "sector")

        assert data.empty
Beispiel #8
0
    def test_collections_bad_type(self):
        with pytest.raises(TypeError):
            get_collections()

        with pytest.raises(ValueError):
            get_collections("Technology", "BADTYPE")
    def test_get_collections(self):
        data = get_collections("Computer Hardware")

        assert isinstance(data, list)
        assert len(data) > 100