-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,19 +9,14 @@ def test_dcatus_to_ckan_transform(test_dcatus_catalog): | |
expected_result = { | ||
"name": "fdic-failed-bank-list", | ||
"owner_org": "test", | ||
"identifier": "https://www.fdic.gov/bank/individual/failed/", | ||
"maintainer": "FDIC Public Data Feedback", | ||
"maintainer_email": "[email protected]", | ||
"notes": "The FDIC is often appointed as receiver for failed banks. This list includes banks which have failed since October 1, 2000.", # noqa E501 | ||
"notes": "The FDIC is often appointed as receiver for failed banks. This list includes banks which have failed since October 1, 2000.", | ||
"title": "FDIC Failed Bank List", | ||
"resources": [ | ||
{ | ||
"url": "https://www.fdic.gov/bank/individual/failed/banklist.csv", | ||
"mimetype": "text/csv", | ||
}, | ||
{ | ||
"url": "https://www.fdic.gov/bank/individual/failed/index.html", | ||
"mimetype": "text/html", | ||
}, | ||
{"url": "https://www.fdic.gov/bank/individual/failed/banklist.csv"}, | ||
{"url": "https://www.fdic.gov/bank/individual/failed/index.html"}, | ||
], | ||
"tags": [ | ||
{"name": "financial-institution"}, | ||
|
@@ -32,32 +27,43 @@ def test_dcatus_to_ckan_transform(test_dcatus_catalog): | |
"extras": [ | ||
{ | ||
"key": "publisher_hierarchy", | ||
"value": "U.S. Government > Federal Deposit Insurance Corporation > Division of Insurance and Research", # noqa E501 | ||
"value": "U.S. Government > Federal Deposit Insurance Corporation > Division of Insurance and Research", | ||
}, | ||
{"key": "resource-type", "value": "Dataset"}, | ||
{"key": "publisher", "value": "Division of Insurance and Research"}, | ||
{"key": "accessLevel", "value": "public"}, | ||
{"key": "bureauCode", "value": ["357:20"]}, | ||
{"key": "bureauCode", "value": "357:20"}, | ||
{ | ||
"key": "identifier", | ||
"value": "https://www.fdic.gov/bank/individual/failed/", | ||
}, | ||
{"key": "modified", "value": "R/P1W"}, | ||
{"key": "programCode", "value": ["000:000"]}, | ||
{"key": "programCode", "value": "000:000"}, | ||
{"key": "publisher", "value": "Division of Insurance and Research"}, | ||
{ | ||
"key": "publisher_hierarchy", | ||
"value": "U.S. Government > Federal Deposit Insurance Corporation > Division of Insurance and Research", # noqa E501 | ||
"value": "U.S. Government > Federal Deposit Insurance Corporation > Division of Insurance and Research", | ||
}, | ||
{"key": "resource-type", "value": "Dataset"}, | ||
{"key": "publisher", "value": "Division of Insurance and Research"}, | ||
{ | ||
"key": "dcat_metadata", | ||
"value": "{'accessLevel': 'public', 'bureauCode': ['357:20'], 'contactPoint': {'fn': 'FDIC Public Data Feedback', 'hasEmail': 'mailto:[email protected]'}, 'description': 'The FDIC is often appointed as receiver for failed banks. This list includes banks which have failed since October 1, 2000.', 'distribution': [{'accessURL': 'https://www.fdic.gov/bank/individual/failed/index.html', 'mediaType': 'text/html'}, {'downloadURL': 'https://www.fdic.gov/bank/individual/failed/banklist.csv', 'mediaType': 'text/csv'}], 'identifier': 'https://www.fdic.gov/bank/individual/failed/', 'keyword': ['assistance transactions', 'banks', 'failures', 'financial institution'], 'modified': 'R/P1W', 'programCode': ['000:000'], 'publisher': {'name': 'Division of Insurance and Research', 'subOrganizationOf': {'name': 'Federal Deposit Insurance Corporation', 'subOrganizationOf': {'name': 'U.S. Government'}}}, 'title': 'FDIC Failed Bank List'}", | ||
}, | ||
{"key": "harvest_source_name", "value": "example_harvest_source_name"}, | ||
], | ||
"author": None, | ||
"author_email": None, | ||
} | ||
|
||
assert ( | ||
DeepDiff(harvester.dcatus_to_ckan(test_dcatus_catalog), expected_result) == {} | ||
DeepDiff( | ||
harvester.dcatus_to_ckan( | ||
test_dcatus_catalog, "example_harvest_source_name" | ||
), | ||
expected_result, | ||
) | ||
== {} | ||
) | ||
|
||
|
||
|