From 4d84079a6b22a0c32d9c87d3c060130c3b7fa7c0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 28 Dec 2023 14:45:40 +0000 Subject: [PATCH] Commit changes made by code formatters --- src/main.py | 6 +++++- test/test_main.py | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index 67f3a0c..2388b81 100644 --- a/src/main.py +++ b/src/main.py @@ -5,6 +5,7 @@ import csv from geocode import geocode, find_timezone, find_country_code + def clean_csv_rows_by_removing_nbsp(unformatted_csv_rows): cleaned_rows = [] @@ -23,6 +24,8 @@ def clean_csv_rows_by_removing_nbsp(unformatted_csv_rows): return cleaned_rows # Convert CSV file to JSON object. + + def convert_csv_to_json(file_path): csv_rows = [] with open(file_path) as csvfile: @@ -64,7 +67,8 @@ def add_geocoding_to_json(data): # Convert CSV to valid JSON json_data_without_geocoding = convert_csv_to_json(csv_file_path) - clean_json_data_without_geocoding = clean_csv_rows_by_removing_nbsp(json_data_without_geocoding) + clean_json_data_without_geocoding = clean_csv_rows_by_removing_nbsp( + json_data_without_geocoding) json_data_with_geocoding = add_geocoding_to_json( clean_json_data_without_geocoding) diff --git a/test/test_main.py b/test/test_main.py index b9d6094..ba9dedf 100644 --- a/test/test_main.py +++ b/test/test_main.py @@ -114,7 +114,8 @@ def test_clean_csv_rows_no_nbsp(self): 'Enable MoJWifi': ' "FALSE"', 'GovWifi Radius Key': '0D0E0DDE000BC0EEE000', 'Wired NACS Radius Key': '00000DD0000BC0EEE000'} ] output_data = clean_csv_rows_by_removing_nbsp(input_data) - self.assertEqual(output_data, input_data, "No non-breaking spaces, should be unchanged") + self.assertEqual(output_data, input_data, + "No non-breaking spaces, should be unchanged") def test_clean_csv_rows_with_nbsp(self): input_data = [ @@ -136,4 +137,5 @@ def test_clean_csv_rows_with_nbsp(self): 'Site Name': 'non breaking space test', 'Wired NACS Radius Key': '00000DD0000BC0EEE000'}] output_data = clean_csv_rows_by_removing_nbsp(input_data) - self.assertEqual(output_data, expected_output, "Non-breaking spaces should be removed") + self.assertEqual(output_data, expected_output, + "Non-breaking spaces should be removed")