Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved tests #145

Merged
merged 6 commits into from
Nov 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Goodtables inspects your tabular data to find general, structure and schema erro

Goodtables support different sources for an inspection. But it should be convertable to dataset presented on a figure 1. Details will be explained in the next sections:

![Dataset](files/dataset.png)
![Dataset](data/dataset.png)

#### Report

Expand Down
Binary file added data/april-to-may-12th-2010.xls
Binary file not shown.
5 changes: 5 additions & 0 deletions data/batch/example.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data,schema,format
https://raw.githubusercontent.com/okfn/goodtables/master/examples/contacts/people.csv,https://raw.githubusercontent.com/okfn/goodtables/master/examples/contacts/schema_valid.json,csv
https://raw.githubusercontent.com/okfn/goodtables/master/examples/required_false.csv,https://raw.githubusercontent.com/okfn/goodtables/master/examples/test_schema.json,csv
https://raw.githubusercontent.com/okfn/goodtables/master/examples/row_limit_structure.csv,,csv
https://raw.githubusercontent.com/okfn/goodtables/master/examples/april-to-may-12th-2010.xls,,excel
3 changes: 3 additions & 0 deletions data/case_insensitive_headers.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ID,nAme,aGE
1101,John,30
1102,Julie,26
2 changes: 2 additions & 0 deletions data/contacts/people.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
first_name,last_name,gender,age,period_employed,period_employed_start,daily_start,daily_end,is_management,avatar,interests,home_location,position_title,extra,notes
Paul,Walsh,M,39,3.25,2012-01-05,08:00:00,17:00:00,Y,YW4gZXhhbXBsZQ==,"['Python','Node','Open Web']","32.123,34.211",product_manager,"{'married': true,'kids': 2}",
3 changes: 3 additions & 0 deletions data/contacts/people_extended.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
first_name,last_name,gender,age,period_employed,period_employed_start,daily_start,daily_end,is_management,avatar,interests,home_location,position_title,extra,notes
Paul,Walsh,M,Thirty Nine,3.25,2012-01-05,08:00:00,17:00:00,Y,<BINARY>,"['Python','Node','Open Web']","32.123,34.211",product_manager,"{'married': true,'kids': 2}",
Paula,Weir,F,37,3.25,2012-01-05,08:00:00,17:00:00,Y,<BINARY>,"['Python','Node','Open Web']","32.123,34.211",product_manager,"{'married': true,'kids': 2}",
2 changes: 2 additions & 0 deletions data/contacts/positions.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name,title,description
product_manager,Product Manager,Manages products
72 changes: 72 additions & 0 deletions data/contacts/schema_incomplete_fields.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"fields": [
{
"name": "first_name",
"title": "First Name",
"type": "string",
"format": "",
"description": "The first name of the person"
},
{
"name": "last_name",
"title": "Last Name",
"type": "string",
"format": "",
"description": "The last name of the person"
},
{
"name": "gender",
"title": "Gender",
"type": "string",
"format": "",
"description": "The gender of the person."
},
{
"name": "age",
"title": "Age",
"type": "integer",
"description": "The age of this person."
},
{
"name": "period_employed",
"title": "Period Employed",
"type": "number",
"description": "The period of employment, in years (eg: 2.6 Y)."
},
{
"name": "is_management",
"title": "Is Management",
"type": "boolean",
"format": "",
"description": "Is this person part of upper management."
},
{
"name": "home_location",
"title": "Home Location",
"type": "string",
"description": "A geopoint for this person's home address."
},
{
"name": "position_title",
"title": "Position Title",
"type": "string",
"description": "This person's position in the company."
}
],
"primaryKey": [
"first_name",
"last_name",
"period_employed",
"home_location"
],
"foreignKeys": [
{
"fields": "position_title",
"reference": {
"datapackage": "",
"resource": "positions",
"fields": "name"
}
}
]
}
98 changes: 98 additions & 0 deletions data/contacts/schema_invalid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"fields": [
{
"name": "first_name",
"title": "First Name",
"type": "string",
"description": "The first name of the person"
},
{
"name": "last_name",
"title": "Last Name",
"type": "integer",
"description": "The last name of the person"
},
{
"name": "gender",
"title": "Gender",
"type": "string",
"description": "The gender of the person."
},
{
"name": "age",
"title": "Age",
"description": "The age of this person."
},
{
"name": "period_employed",
"title": "Period Employed",
"description": "The period of employment, in years (eg: 2.6 Y)."
},
{
"name": "period_employed_start",
"title": "Employment Start",
"description": "The date this person started employment."
},
{
"name": "daily_start",
"title": "Daily Start",
"description": "Usual start time for this person."
},
{
"name": "daily_end",
"title": "Daily End",
"description": "Usual end time for this person."
},
{
"name": "is_management",
"title": "Is Management",
"description": "Is this person part of upper management."
},
{
"name": "avatar",
"title": "Avatar",
"description": "A photo of this person."
},
{
"name": "interests",
"title": "Interests",
"description": "Declared interests of this person (work-related)."
},
{
"name": "home_location",
"title": "Home Location",
"description": "A geopoint for this person's home address."
},
{
"name": "position_title",
"title": "Position Title",
"description": "This person's position in the company."
},
{
"name": "extra",
"title": "Extra",
"description": "Extra information about this person."
},
{
"name": "notes",
"title": "Notes",
"description": "Add any relevant notes for HR."
}
],
"primaryKey": [
"first_name",
"last_name",
"period_employed",
"home_location"
],
"foreignKeys": [
{
"fields": "position_title",
"reference": {
"datapackage": "",
"resource": "positions",
"fields": "name"
}
}
]
}
121 changes: 121 additions & 0 deletions data/contacts/schema_valid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"fields": [
{
"name": "first_name",
"title": "First Name",
"type": "string",
"format": "",
"description": "The first name of the person"
},
{
"name": "last_name",
"title": "Last Name",
"type": "string",
"format": "",
"description": "The last name of the person"
},
{
"name": "gender",
"title": "Gender",
"type": "string",
"format": "",
"description": "The gender of the person."
},
{
"name": "age",
"title": "Age",
"type": "integer",
"description": "The age of this person."
},
{
"name": "period_employed",
"title": "Period Employed",
"type": "number",
"description": "The period of employment, in years (eg: 2.6 Y)."
},
{
"name": "period_employed_start",
"title": "Employment Start",
"type": "date",
"format": "",
"description": "The date this person started employment."
},
{
"name": "daily_start",
"title": "Daily Start",
"type": "time",
"format": "",
"description": "Usual start time for this person."
},
{
"name": "daily_end",
"title": "Daily End",
"type": "time",
"format": "",
"description": "Usual end time for this person."
},
{
"name": "is_management",
"title": "Is Management",
"type": "boolean",
"format": "",
"description": "Is this person part of upper management."
},
{
"name": "avatar",
"title": "Avatar",
"type": "string",
"format": "binary",
"description": "A photo of this person."
},
{
"name": "interests",
"title": "Interests",
"type": "string",
"description": "Declared interests of this person (work-related)."
},
{
"name": "home_location",
"title": "Home Location",
"type": "string",
"description": "A geopoint for this person's home address."
},
{
"name": "position_title",
"title": "Position Title",
"type": "string",
"description": "This person's position in the company."
},
{
"name": "extra",
"title": "Extra",
"type": "string",
"description": "Extra information about this person."
},
{
"name": "notes",
"title": "Notes",
"type": "any",
"description": "Add any relevant notes for HR.",
"constraints": {
"required": false
}
}
],
"primaryKey": [
"first_name",
"last_name",
"period_employed",
"home_location"
],
"foreignKeys": [
{
"fields": "position_title",
"reference": {
"datapackage": "",
"resource": "positions",
"fields": "name"
}
}
]
}
Loading