Update test for renamed restkey, refs #440, #443

This commit is contained in:
Simon Willison 2022-06-14 14:14:10 -07:00
commit 0cee77b176
3 changed files with 24 additions and 14 deletions

View file

@ -19,7 +19,7 @@ def test_rows_from_file_detect_format(input, expected_format):
@pytest.mark.parametrize(
"ignore_extras,restkey,expected",
"ignore_extras,extras_key,expected",
(
(True, None, [{"id": "1", "name": "Cleo"}]),
(False, "_rest", [{"id": "1", "name": "Cleo", "_rest": ["oops"]}]),
@ -27,13 +27,13 @@ def test_rows_from_file_detect_format(input, expected_format):
(False, False, None),
),
)
def test_rows_from_file_extra_fields_strategies(ignore_extras, restkey, expected):
def test_rows_from_file_extra_fields_strategies(ignore_extras, extras_key, expected):
try:
rows, format = rows_from_file(
BytesIO(b"id,name\r\n1,Cleo,oops"),
format=Format.CSV,
ignore_extras=ignore_extras,
restkey=restkey,
extras_key=extras_key,
)
list_rows = list(rows)
except RowError: