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

Commit

Permalink
Added multipart resource test scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
roll committed Aug 16, 2019
1 parent b9806dd commit 2729f7c
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 2 deletions.
2 changes: 2 additions & 0 deletions data/datapackages/multipart/data.part1.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,name
1,london
1 change: 1 addition & 0 deletions data/datapackages/multipart/data.part2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2,paris
2 changes: 2 additions & 0 deletions data/datapackages/multipart/data.part3.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
3,rome
bad,rio
26 changes: 26 additions & 0 deletions data/datapackages/multipart/datapackage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "datapackage",
"resources": [
{
"name": "data",
"path": [
"data.part1.csv",
"data.part2.csv",
"data.part3.csv"
],
"profile": "tabular-data-resource",
"schema": {
"fields": [
{
"name": "id",
"type": "integer"
},
{
"name": "name",
"type": "string"
}
]
}
}
]
}
2 changes: 1 addition & 1 deletion goodtables/schemas/report.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"minimum": 0
},
"source": {
"type": "string",
"type": ["string", "array"],
"title": "Source",
"description": "Path or URI where this table was loaded from."
},
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def read(*paths):
'lxml>=3.0',
]
TESTS_REQUIRE = [
'pyyaml',
'pylama',
'pytest',
'mock',
Expand Down
5 changes: 5 additions & 0 deletions tests/scenarios/multipart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
datapackages:
source: data/datapackages/multipart/datapackage.json
preset: datapackage
report:
- [1, 5, 1, 'type-or-format-error']
1 change: 0 additions & 1 deletion tests/test_scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def test_scenarios(log, name, scenario):
def test_scenarios_return_valid_reports(name, scenario, report_schema):
del scenario['report']
report = validate(**scenario)

jsonschema.validate(report, report_schema)


Expand Down

0 comments on commit 2729f7c

Please sign in to comment.