Skip to content

Commit

Permalink
Cleanup tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ABPLMC committed May 16, 2024
1 parent 483febf commit d8175d2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions api/datalake_api/querier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}')
Expand Down
2 changes: 1 addition & 1 deletion api/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/tests/test_archive_querier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit d8175d2

Please sign in to comment.