diff --git a/tests/data/scripts/unit/test_clean_all_years.py b/tests/data/scripts/unit/test_clean_all_years.py index 9e8e9561..21ccea6d 100644 --- a/tests/data/scripts/unit/test_clean_all_years.py +++ b/tests/data/scripts/unit/test_clean_all_years.py @@ -22,7 +22,7 @@ def src_building_data() -> pd.DataFrame: @pytest.fixture def csv_file() -> csv.reader: csvfile = open(get_test_file_path(test_input_file)) - return csv.reader(csvfile) + return csv.reader(csvfile) def test_csv_file_has_some_data(csv_file): first_line = csv_file.__next__() @@ -48,7 +48,7 @@ def test_columns_are_renamed(src_building_data) -> pd.DataFrame: return df def test_data_has_positive_ghg_data(test_columns_are_renamed): - df = clean.get_all_ghg_data(test_columns_are_renamed) + df = clean.get_buildings_with_ghg_intensity(test_columns_are_renamed) assert df is not None assert np.all(df['GHGIntensity'] > 0) @@ -64,12 +64,12 @@ def test_has_last_year_of_data(test_columns_are_renamed) -> pd.DataFrame: @pytest.fixture def fixed_strings(test_has_last_year_of_data, test_columns_are_renamed): - return clean.fix_str_cols(test_has_last_year_of_data, + return clean.fix_str_cols(test_has_last_year_of_data, test_columns_are_renamed) @pytest.fixture def fixed_strings_all_years(test_columns_are_renamed): - return clean.fix_str_cols(test_columns_are_renamed, + return clean.fix_str_cols(test_columns_are_renamed, test_columns_are_renamed) def test_str_values_remain_the_same_as_origin(fixed_strings_all_years, csv_file): @@ -88,7 +88,7 @@ def test_str_values_remain_the_same_as_origin(fixed_strings_all_years, csv_file) def test_lat_lon_become_strings(fixed_strings): df = fixed_strings[['Latitude','Longitude']] assert np.all(df.dtypes == 'string') - + def test_int_values_remain_the_same_as_origin(test_has_last_year_of_data): df = clean.fix_int_cols(test_has_last_year_of_data) assert np.all(df[clean.int_cols].dtypes == 'Int64')