From 81bce8482279c5b2f282fb1151507da7aa648df1 Mon Sep 17 00:00:00 2001 From: Onel Harrison Date: Fri, 6 Mar 2020 14:14:12 -0500 Subject: [PATCH] Fix condition for reading files with different file types --- tests/chp3/video3/test_parametrize_start.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/chp3/video3/test_parametrize_start.py b/tests/chp3/video3/test_parametrize_start.py index 2cb0462..d036d84 100644 --- a/tests/chp3/video3/test_parametrize_start.py +++ b/tests/chp3/video3/test_parametrize_start.py @@ -16,10 +16,11 @@ def process_data(city_list_location): def _specify_type(file_name_or_type): for f in files: if file_name_or_type in f: - if file_name_or_type != '.json': - data = data_processor.csv_reader(city_list_location + f) - else: + if file_name_or_type.endswith('.json'): data = data_processor.json_reader(city_list_location + f) + elif file_name_or_type.endswith('.csv'): + data = data_processor.csv_reader(city_list_location + f) + return data yield _specify_type