From f14c48b1da0d0a765bf961e838dc3a857b69c07d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Am=C3=A9lie=20Rondot?= Date: Sat, 10 Feb 2024 18:10:07 +0100 Subject: [PATCH] Refacto: refactoring test --- tests/table/test_header.py | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/tests/table/test_header.py b/tests/table/test_header.py index b83618cfe8..2189baeb2e 100644 --- a/tests/table/test_header.py +++ b/tests/table/test_header.py @@ -47,11 +47,11 @@ def test_missing_primary_key_label_with_shema_sync_issue_1633(): "nb_errors": 1, "types_errors_expected": ["missing-label"], }, - # { # This test case raise the unexpected KeyError we want to fix - # "constraints": {}, - # "nb_errors": 1, - # "types_errors_expected": ["missing-label"], - # }, + { + "constraints": {}, + "nb_errors": 1, + "types_errors_expected": ["missing-label"], + }, ] for tc in test_cases: @@ -75,24 +75,6 @@ def test_missing_primary_key_label_with_shema_sync_issue_1633(): for error, type_expected in zip(errors, tc["types_errors_expected"]): assert error.type == type_expected - # TODO: fix this isolated test case and refactoring - schema_descriptor = { - "$schema": "https://frictionlessdata.io/schemas/table-schema.json", - "fields": [{"name": "A"}], - "primaryKey": ["A"], - } - - resource = TableResource( - source=[["B"], ["foo"]], - schema=Schema.from_descriptor(schema_descriptor), - detector=frictionless.Detector(schema_sync=True), - ) - - report = frictionless.validate(resource) - errors = report.tasks[0].errors - assert len(errors) == 1 - assert errors[0].type == "missing-label" - # # Ignore header_case # schema_descriptor = { # "$schema": "https://frictionlessdata.io/schemas/table-schema.json",