self = <swh.search.tests.test_api_client.TestRemoteSearch testMethod=test_origin_last_visit_date_update_search>
def test_origin_last_visit_date_update_search(self):
origin_url = "http://foobar.baz"
self.search.origin_update([{"url": origin_url}])
self.search.flush()
def _update_last_visit_date(last_visit_date):
self.search.origin_update(
[{"url": origin_url, "last_visit_date": last_visit_date}]
)
self.search.flush()
def _check_last_visit_date(last_visit_date):
actual_page = self.search.origin_search(
url_pattern=origin_url, last_visit_date=last_visit_date,
)
assert actual_page.next_page_token is None
results = [r["url"] for r in actual_page.results]
expected_results = [origin_url]
assert sorted(results) == sorted(expected_results)
now = datetime.now(tz=timezone.utc).isoformat()
now_minus_5_hours = (
datetime.now(tz=timezone.utc) - timedelta(hours=5)
).isoformat()
_update_last_visit_date(now)
> _check_last_visit_date(now)
.tox/py3/lib/python3.7/site-packages/swh/search/tests/test_search.py:243:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
last_visit_date = '2021-06-10T12:06:00.530661+00:00'
def _check_last_visit_date(last_visit_date):
actual_page = self.search.origin_search(
url_pattern=origin_url, last_visit_date=last_visit_date,
)
assert actual_page.next_page_token is None
results = [r["url"] for r in actual_page.results]
expected_results = [origin_url]
> assert sorted(results) == sorted(expected_results)
E AssertionError: assert [] == ['http://foobar.baz']
E Right contains one more item: 'http://foobar.baz'
E Full diff:
E - ['http://foobar.baz']
E + []
.tox/py3/lib/python3.7/site-packages/swh/search/tests/test_search.py:235: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Jun 10 2021, 2:08 PM