Skip to content

Commit

Permalink
update expected result.
Browse files Browse the repository at this point in the history
  • Loading branch information
rshewitt committed Jan 3, 2024
1 parent 851382f commit 67f0592
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions tests/unit/load/ckan/test_ckan_cud.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand All @@ -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,
)
== {}
)


Expand Down

0 comments on commit 67f0592

Please sign in to comment.