From 83985ab3cf5d22d3987448ea7f86b7b626d51e51 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Tue, 20 Sep 2022 16:29:23 +0200 Subject: [PATCH] test(import_csv): highlight differences between passed and returned options in parse_file --- sandbox/grist/imports/import_csv_test.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sandbox/grist/imports/import_csv_test.py b/sandbox/grist/imports/import_csv_test.py index 955a0c01..320129ba 100644 --- a/sandbox/grist/imports/import_csv_test.py +++ b/sandbox/grist/imports/import_csv_test.py @@ -83,9 +83,15 @@ class TestImportCSV(unittest.TestCase): "limit_rows": False, "quoting": 0, "start_with_row": 1, "delimiter": ",", "NUM_ROWS":10, "quotechar": "\"", "doublequote":True}} - options, parsed_file = import_csv.parse_file(_get_fixture('test_import_csv.csv'), + parsed_options, parsed_file = import_csv.parse_file(_get_fixture('test_import_csv.csv'), **options) - self._check_options(options) + parsed_options.pop("SCHEMA") # This key was not passed. + # Those keys are not returned by parse_file, so remove them for now, before comparing. + options["parse_options"].pop("limit_rows") + options["parse_options"].pop("quoting") + options["parse_options"].pop("escapechar") + self.assertEqual(options["parse_options"], parsed_options) + self._check_options(parsed_options) parsed_file = parsed_file[0] self._check_num_cols(parsed_file, 5)