Changeset View
Changeset View
Standalone View
Standalone View
swh/search/tests/test_cli.py
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | def test__journal_client__origin(self): | ||||
# Check the output | # Check the output | ||||
expected_output = ( | expected_output = ( | ||||
'Processed 1 messages.\n' | 'Processed 1 messages.\n' | ||||
'Done.\n' | 'Done.\n' | ||||
) | ) | ||||
assert result.exit_code == 0, result.output | assert result.exit_code == 0, result.output | ||||
assert result.output == expected_output | assert result.output == expected_output | ||||
self.search.flush() | |||||
results = self.search.origin_search(url_pattern='foobar') | results = self.search.origin_search(url_pattern='foobar') | ||||
assert results == {'next_page_token': None, 'results': [ | assert results == {'next_page_token': None, 'results': [ | ||||
{'url': 'http://foobar.baz'}]} | {'url': 'http://foobar.baz'}]} | ||||
results = self.search.origin_search(url_pattern='foobar', | results = self.search.origin_search(url_pattern='foobar', | ||||
with_visit=True) | with_visit=True) | ||||
assert results == {'next_page_token': None, 'results': []} | assert results == {'next_page_token': None, 'results': []} | ||||
Show All 22 Lines | def test__journal_client__origin_visit(self): | ||||
# Check the output | # Check the output | ||||
expected_output = ( | expected_output = ( | ||||
'Processed 1 messages.\n' | 'Processed 1 messages.\n' | ||||
'Done.\n' | 'Done.\n' | ||||
) | ) | ||||
assert result.exit_code == 0, result.output | assert result.exit_code == 0, result.output | ||||
assert result.output == expected_output | assert result.output == expected_output | ||||
self.search.flush() | |||||
results = self.search.origin_search(url_pattern='foobar', | results = self.search.origin_search(url_pattern='foobar', | ||||
with_visit=True) | with_visit=True) | ||||
assert results == {'next_page_token': None, 'results': [ | assert results == {'next_page_token': None, 'results': [ | ||||
{'url': 'http://foobar.baz'}]} | {'url': 'http://foobar.baz'}]} |