Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
Added order_fields test related to skipping checks (#361)
Browse files Browse the repository at this point in the history
* Added a failing test

* Fixed the test
  • Loading branch information
roll committed Apr 27, 2020
1 parent dc89fa1 commit 26c9524
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Binary file added data/order_fields_313.xlsx
Binary file not shown.
15 changes: 15 additions & 0 deletions tests/test_validate.py
Expand Up @@ -444,3 +444,18 @@ def test_validate_invalid_table_schema_issue_304(log):
]}
report = validate(source, schema=schema)
assert not report['valid']


def test_validate_order_fields_issue_313(log):
source = 'data/order_fields_313.xlsx'
schema = {'fields': [
{ 'name': 'Column_1', 'type': 'string', },
{ 'name': 'Column_2', 'type': 'string', 'constraints': { 'required': True } },
{ 'name': 'Column_3', 'type': 'string' },
{ 'name': 'Column_4', 'type': 'string' },
{ 'name': 'Column_5', 'type': 'string' }
]}
# For now, the "non-matching-header" check is required to order the fields
checks = ['non-matching-header', 'required-constraint']
report = validate(source, schema=schema, checks=checks, order_fields=True)
assert report['valid']

0 comments on commit 26c9524

Please sign in to comment.