Skip to content

Commit

Permalink
Adapt tests to latest changes in ckanext-harvest
Browse files Browse the repository at this point in the history
  • Loading branch information
seitenbau-govdata committed Jun 1, 2023
1 parent 14396e6 commit 913480d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions ckanext/dcat/tests/test_harvester.py
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ def _test_harvest_bad_format(self, url, bad_content, content_type):

assert last_job_status['status'] == 'Finished'
assert ('Error parsing the RDF file'
in last_job_status['gather_error_summary'][0][0])
in last_job_status['gather_error_summary'][0]['message'])

@responses.activate
@patch.object(ckanext.dcat.harvesters.rdf.RDFParser, 'datasets')
Expand Down Expand Up @@ -1082,7 +1082,7 @@ def test_harvest_exception_in_profile(self, mock_datasets):

assert last_job_status['status'] == 'Finished'
assert ('Error when processsing dataset'
in last_job_status['gather_error_summary'][0][0])
in last_job_status['gather_error_summary'][0]['message'])

@responses.activate
def test_harvest_create_duplicate_titles(self):
Expand Down Expand Up @@ -1219,8 +1219,8 @@ def test_harvest_before_download_errors_get_stored(self, reset_calls_counter):

last_job_status = harvest_source['status']['last_job']

assert 'Error 1' == last_job_status['gather_error_summary'][0][0]
assert 'Error 2' == last_job_status['gather_error_summary'][1][0]
assert 'Error 1' == last_job_status['gather_error_summary'][0]['message']
assert 'Error 2' == last_job_status['gather_error_summary'][1]['message']

def test_harvest_update_session_extension_point_gets_called(self, reset_calls_counter):

Expand Down Expand Up @@ -1365,8 +1365,8 @@ def test_harvest_after_download_errors_get_stored(self, reset_calls_counter):

last_job_status = harvest_source['status']['last_job']

assert 'Error 1' == last_job_status['gather_error_summary'][0][0]
assert 'Error 2' == last_job_status['gather_error_summary'][1][0]
assert 'Error 1' == last_job_status['gather_error_summary'][0]['message']
assert 'Error 2' == last_job_status['gather_error_summary'][1]['message']

@responses.activate
def test_harvest_after_parsing_extension_point_gets_called(self, reset_calls_counter):
Expand Down Expand Up @@ -1480,8 +1480,8 @@ def test_harvest_after_parsing_errors_get_stored(self, reset_calls_counter):

last_job_status = harvest_source['status']['last_job']

assert 'Error 1' == last_job_status['gather_error_summary'][0][0]
assert 'Error 2' == last_job_status['gather_error_summary'][1][0]
assert 'Error 1' == last_job_status['gather_error_summary'][0]['message']
assert 'Error 2' == last_job_status['gather_error_summary'][1]['message']
finally:
plugin.after_parsing_mode = ''

Expand Down Expand Up @@ -1648,7 +1648,7 @@ def test_harvest_with_before_create_raising_exception(self, reset_calls_counter)
assert last_job_status['status'] == 'Finished'

assert ('Error importing dataset'
in last_job_status['object_error_summary'][0][0])
in last_job_status['object_error_summary'][0]['message'])

assert (
last_job_status['stats'] ==
Expand Down

0 comments on commit 913480d

Please sign in to comment.