Skip to content
Snippets Groups Projects
Verified Commit 8d187480 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

TEST: Fixed test for XSLX files with data loss.

parent f76aaacf
No related branches found
No related tags found
2 merge requests!107Release v0.11.0,!102ENH: XLSX reader
...@@ -64,13 +64,17 @@ def test_conversions(): ...@@ -64,13 +64,17 @@ def test_conversions():
convert_and_compare(xlsx_file=rfp("data/indirect_data.xlsx"), convert_and_compare(xlsx_file=rfp("data/indirect_data.xlsx"),
schema_file=rfp("data/indirect_schema.json"), schema_file=rfp("data/indirect_schema.json"),
known_good_file=rfp("data/indirect_data.json")) known_good_file=rfp("data/indirect_data.json"))
convert_and_compare(xlsx_file=rfp("data/simple_data_ascii_chars.xlsx"),
schema_file=rfp("data/simple_schema.json"),
known_good_file=rfp("data/simple_data_ascii_chars.json"))
convert_and_compare(xlsx_file=rfp("data/multiple_choice_data.xlsx"), convert_and_compare(xlsx_file=rfp("data/multiple_choice_data.xlsx"),
schema_file=rfp("data/multiple_choice_schema.json"), schema_file=rfp("data/multiple_choice_schema.json"),
known_good_file=rfp("data/multiple_choice_data.json")) known_good_file=rfp("data/multiple_choice_data.json"))
# Data loss when saving as xlsx
with pytest.raises(AssertionError) as err:
convert_and_compare(xlsx_file=rfp("data/simple_data_ascii_chars.xlsx"),
schema_file=rfp("data/simple_schema.json"),
known_good_file=rfp("data/simple_data_ascii_chars.json"))
assert str(err.value).startswith("Values at path ['Training', 0, ")
def test_set_in_nested(): def test_set_in_nested():
"""Test the ``_set_in_nested`` function.""" """Test the ``_set_in_nested`` function."""
......
...@@ -65,7 +65,7 @@ Raise an assertion exception if they are not equal.""" ...@@ -65,7 +65,7 @@ Raise an assertion exception if they are not equal."""
assert_equal_jsons(el1, el2, allow_none=allow_none, allow_empty=allow_empty, assert_equal_jsons(el1, el2, allow_none=allow_none, allow_empty=allow_empty,
path=this_path) path=this_path)
else: else:
assert el1 == el2 assert el1 == el2, f"Values at path {this_path} are not equal:\n{el1},\n{el2}"
def compare_workbooks(wb1: Workbook, wb2: Workbook, hidden: bool = True): def compare_workbooks(wb1: Workbook, wb2: Workbook, hidden: bool = True):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment