Пример #1
0
def test_interface_table_registry():
    # Test if script_table_registry keeps only the latest
    # table names of the installed data packages in
    # script_table_registry
    install_csv("iris")
    wine_data = fetch("wine-composition")
    assert "iris" not in wine_data.keys()
Пример #2
0
def test_interface_table_registry():
    # Test if script_table_registry keeps only the latest
    # table names of the installed data packages in
    # script_table_registry
    install_csv("iris")
    wine_data = fetch("wine-composition")
    assert "iris" not in wine_data.keys()
Пример #3
0
def test_interface_table_registry(tmpdir):
    # Test if script_table_registry keeps only the latest
    # table names of the installed data packages in
    # script_table_registry

    workdir = tmpdir.mkdtemp()
    workdir.chdir()
    rt.install_csv("iris")
    wine_data = rt.fetch("wine-composition")
    assert "iris" not in wine_data.keys()
    os.chdir(retriever_root_dir)
Пример #4
0
def test_interface_table_registry(tmpdir):
    # Test if script_table_registry keeps only the latest
    # table names of the installed data packages in
    # script_table_registry
    
    workdir = tmpdir.mkdtemp()
    workdir.chdir()
    rt.install_csv("iris")
    wine_data = rt.fetch("wine-composition")
    assert "iris" not in wine_data.keys()
    os.chdir(retriever_root_dir)
Пример #5
0
def test_fetch():
    """Test fetch interface"""
    for dataset, expected in fetch_tests:
        data_frame = fetch(dataset)
        for itm in expected:
            for table_i in itm:
                expected_data = itm[table_i][0]
                expected_column_values = itm[table_i][1]
                column_values = list(data_frame[table_i].dtypes.index)
                first_row_data = list(data_frame[table_i].iloc[0])
                assert expected_data == first_row_data
                assert expected_column_values == column_values
Пример #6
0
def test_fetch():
    """Test fetch interface"""
    for dataset, expected in fetch_tests:
        data_frame = fetch(dataset)
        for itm in expected:
            for table_i in itm:
                expected_data = itm[table_i][0]
                expected_column_values = itm[table_i][1]
                column_values = list(data_frame[table_i].dtypes.index)
                first_row_data = list(data_frame[table_i].iloc[0])
                assert expected_data == first_row_data
                assert expected_column_values == column_values
Пример #7
0
def test_fetch_order(dataset, expected):
    """Test fetch dataframe order"""
    data_frame_dict = fetch(dataset)
    assert list(data_frame_dict.keys()) == expected
Пример #8
0
def test_fetch_order(dataset, expected):
    """Test fetch dataframe order"""
    data_frame_dict = fetch(dataset)
    assert list(data_frame_dict.keys()) == expected