Skip to content

Commit

Permalink
Merge pull request #1069 from open-contracting/861-change-default-to-…
Browse files Browse the repository at this point in the history
…skip-checks

feat: remove check for default steps in kigfisher process
  • Loading branch information
yolile committed Apr 11, 2024
2 parents e366664 + b2a7de2 commit 59fa012
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion kingfisher_scrapy/base_spiders/base_spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def __init__(self, sample=None, path=None, from_date=None, until_date=None, craw
self.kingfisher_process_note = note
self.kingfisher_process_keep_collection_open = keep_collection_open == 'true'
if steps is None:
self.kingfisher_process_steps = self.available_steps
self.kingfisher_process_steps = {'compile'}
else:
self.kingfisher_process_steps = set(steps.split(',')) & self.available_steps

Expand Down
15 changes: 10 additions & 5 deletions tests/extensions/test_kingfisher_process_api2.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,13 @@ def test_from_crawler_with_database_url():
@pytest.mark.parametrize('note', [None, 'Started by NAME.'])
@pytest.mark.parametrize('job', [None, '7df53218f37a11eb80dd0c9d92c523cb'])
@pytest.mark.parametrize('ocds_version,upgrade', [('1.0', True), (None, False)])
@pytest.mark.parametrize('steps', [None, 'compile,check,invalid', 'compile', 'check'])
@pytest.mark.parametrize('steps,expected_steps', [
(None, ['compile']),
('compile,check,invalid', ['compile', 'check']),
('compile', ['compile']),
('check', ['check']),
('', []),
])
@pytest.mark.parametrize('call_count,status_code,messages', [
(2, 200, [
('INFO', 'Created collection 1 in Kingfisher Process'), ('INFO', 'Closed collection 1 in Kingfisher Process')
Expand All @@ -149,6 +155,7 @@ def test_spider_opened(
ocds_version,
upgrade,
steps,
expected_steps,
call_count,
status_code,
messages,
Expand All @@ -174,10 +181,8 @@ def test_spider_opened(
'job': job,
'upgrade': upgrade,
}
if steps != 'check':
expected['compile'] = True
if steps != 'compile':
expected['check'] = True
for step in expected_steps:
expected[step] = True

calls = mock.call_args_list

Expand Down

0 comments on commit 59fa012

Please sign in to comment.