From d8175d2e401ba49f38f731c273f592558e77fa28 Mon Sep 17 00:00:00 2001 From: Alex Bednarek Date: Thu, 16 May 2024 16:37:37 -0400 Subject: [PATCH] Cleanup tests. --- api/datalake_api/querier.py | 6 +++--- api/tests/conftest.py | 2 +- api/tests/test_archive_querier.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/datalake_api/querier.py b/api/datalake_api/querier.py index 54e78f6..c1ef474 100644 --- a/api/datalake_api/querier.py +++ b/api/datalake_api/querier.py @@ -173,10 +173,10 @@ def _unpack(self, result): class ArchiveQuerier(object): - def __init__(self, table_name, dynamodb=None, use_latest=None): + def __init__(self, table_name, dynamodb=None): self.table_name = table_name self.dynamodb = dynamodb - self.use_latest = use_latest + self.use_latest = False def query_by_work_id(self, work_id, what, where=None, cursor=None): kwargs = self._prepare_work_id_kwargs(work_id, what) @@ -337,7 +337,7 @@ def _table(self): def _latest_table(self): return self.dynamodb.Table('test_latest') - def query_latest(self, what, where, lookback_days=DEFAULT_LOOKBACK_DAYS, use_latest=False): + def query_latest(self, what, where, lookback_days=DEFAULT_LOOKBACK_DAYS): if self.use_latest: response = self._latest_table.query( KeyConditionExpression=Key('what_where_key').eq(f'{what}:{where}') diff --git a/api/tests/conftest.py b/api/tests/conftest.py index da0c9ec..44da97b 100644 --- a/api/tests/conftest.py +++ b/api/tests/conftest.py @@ -186,7 +186,7 @@ def _populate_table(table, records): @pytest.fixture def table_maker(request, dynamodb): - def maker(records, use_latest=False): + def maker(records): table_name = 'test' latest_table_name = 'test_latest' latest_table = None diff --git a/api/tests/test_archive_querier.py b/api/tests/test_archive_querier.py index da89cb2..159aa5c 100644 --- a/api/tests/test_archive_querier.py +++ b/api/tests/test_archive_querier.py @@ -126,7 +126,7 @@ def query_latest(self, what, where): @pytest.fixture(params=[ArchiveQuerier, HttpQuerier], ids=['archive_querier', 'http']) def querier(request, dynamodb): - return request.param('test', dynamodb=dynamodb, use_latest=True) + return request.param('test', dynamodb=dynamodb) def in_url(result, part): url = result['url']