Exemplo n.º 1
0
def test_clean_df():
    path = path1 + POLLUTANT.pm10.name + path2
    df = get_stations_data(path)
    assert df is not None
    assert len(df.columns) == 8
    clean_df(df)
    assert len(df.columns) == 2
Exemplo n.º 2
0
def test_get_best_no2_stations():
    path = path1 + POLLUTANT.no2.name + path2
    df = get_stations_data(path)
    size = len(df)

    df = get_best_stations(path, POLLUTANT.no2)
    assert df is not None
    assert len(df) < size
    # number of best station/city for 'no2'
    assert len(df) == 557
Exemplo n.º 3
0
def get_worst_stations_helper(pollutant: POLLUTANT, cities: int):
    path = path1 + pollutant.name + path2
    df = get_stations_data(path)
    size = len(df)

    df = get_worst_stations(path, pollutant)
    assert df is not None
    assert len(df) < size
    # number of worst station/city for a pollutant
    assert len(df) == cities
Exemplo n.º 4
0
def test_get_mean_per_city():
    path = path1 + POLLUTANT.pm10.name + path2
    df = get_stations_data(path)
    size = len(df)

    df = get_mean_per_city(path, POLLUTANT.pm10)
    assert df is not None
    assert len(df) < size
    # number of best station/city for 'no2'
    assert len(df) == 525
    assert len(df.columns) == 3
Exemplo n.º 5
0
def test_filter_main_cities():
    path = path1 + POLLUTANT.pm10.name + path2
    df = filter_main_cities(get_stations_data(path))
    assert df is not None
    assert len(df) == 121
Exemplo n.º 6
0
def test_get_stations_data():
    path = path1 + POLLUTANT.pm10.name + path2
    df = get_stations_data(path)
    assert df is not None