From b2ea2e71f5c7b00e81caff33bdb74c790b7cc128 Mon Sep 17 00:00:00 2001 From: Tim van den Aardweg Date: Mon, 17 Apr 2023 14:14:01 +0200 Subject: [PATCH] Implemented review comments --- hydrolib/core/dflowfm/xyn/parser.py | 2 +- tests/dflowfm/test_xyn.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hydrolib/core/dflowfm/xyn/parser.py b/hydrolib/core/dflowfm/xyn/parser.py index 612221318..40e45ccae 100644 --- a/hydrolib/core/dflowfm/xyn/parser.py +++ b/hydrolib/core/dflowfm/xyn/parser.py @@ -66,7 +66,7 @@ def contains_whitespace_while_not_allowed(name: str) -> bool: if contains_whitespace_while_not_allowed(n): raise ValueError( - f"Error parsing XYN file '{filepath}', line {linenr+1}. Name `{n}` contains whitespace, so should be enclosed in single quotes." + f"Error parsing XYN file '{filepath}', line {linenr+1}. Name `{n}` contains whitespace, so should be enclosed in quotes." ) if is_surrounded_by_quotes(n): diff --git a/tests/dflowfm/test_xyn.py b/tests/dflowfm/test_xyn.py index eeb9b0ff1..cdb77759b 100644 --- a/tests/dflowfm/test_xyn.py +++ b/tests/dflowfm/test_xyn.py @@ -31,7 +31,7 @@ def test_parse_xyn_file(self): with create_temp_file(file_content, "test.xyn") as xyn_file: parsed_contents = XYNParser.parse(xyn_file) - assert expected_result == parsed_contents + assert expected_result == parsed_contents def test_parse_xyn_file_with_single_quoted_name_removes_quotes_and_keeps_whitespace( self, @@ -48,7 +48,7 @@ def test_parse_xyn_file_with_single_quoted_name_removes_quotes_and_keeps_whitesp with create_temp_file(file_content, "test.xyn") as xyn_file: parsed_contents = XYNParser.parse(xyn_file) - assert expected_result == parsed_contents + assert expected_result == parsed_contents def test_parse_xyn_file_with_double_quoted_name_removes_quotes_and_keeps_whitespace( self, @@ -74,7 +74,7 @@ def test_parse_xyn_file_with_too_many_columns_raises_error(self): with pytest.raises(ValueError) as error: with create_temp_file(file_content, "test.xyn") as xyn_file: - expected_message = f"Error parsing XYN file '{xyn_file}', line 1. Name `{name}` contains whitespace, so should be enclosed in single quotes." + expected_message = f"Error parsing XYN file '{xyn_file}', line 1. Name `{name}` contains whitespace, so should be enclosed in quotes." _ = XYNParser.parse(xyn_file) assert expected_message in str(error.value) @@ -99,7 +99,7 @@ def test_serialize_xyn_point(self): with open(xyn_file) as file: file_content = file.readlines() - assert file_content == expected_file_content + assert file_content == expected_file_content class TestXYNModel: