Skip to content

Commit

Permalink
repair unit tests with new _source fields
Browse files Browse the repository at this point in the history
  • Loading branch information
akarve committed Jan 12, 2021
1 parent 918c61f commit 7e82dde
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions lambdas/search/tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,19 @@ def test_search(self):
'size': 1000,
'from': 0,
'_source': ','.join([
'key', 'version_id', 'updated', 'last_modified', 'size', 'user_meta',
'comment', 'handle', 'hash', 'tags', 'metadata', 'pointer_file'
'key',
'version_id',
'updated',
'last_modified',
'size',
'user_meta',
'comment',
'handle',
'hash',
'tags',
'metadata',
'pointer_file',
'delete_marker',
]),
'terminate_after': 538,
})
Expand Down Expand Up @@ -342,8 +353,19 @@ def test_search_retry(self):
'size': 1000,
'from': 0,
'_source': ','.join([
'key', 'version_id', 'updated', 'last_modified', 'size', 'user_meta',
'comment', 'handle', 'hash', 'tags', 'metadata', 'pointer_file'
'key',
'version_id',
'updated',
'last_modified',
'size',
'user_meta',
'comment',
'handle',
'hash',
'tags',
'metadata',
'pointer_file',
'delete_marker',
]),
'terminate_after': 10000,
})
Expand Down Expand Up @@ -393,13 +415,14 @@ def test_stats(self):
def _callback(request):
payload = json.loads(request.body)
assert payload == {
"query": {"match_all": {}},
"query": {"term": {"delete_marker": False}},
"aggs": {
"totalBytes": {"sum": {"field": "size"}},
"totalBytes": {"sum": {"field": 'size'}},
"exts": {
"terms": {"field": 'ext'},
"aggs": {"size": {"sum": {"field": "size"}}},
"aggs": {"size": {"sum": {"field": 'size'}}},
},
# TODO: move this to a separate action (pkg_stats)
"totalPackageHandles": {"value_count": {"field": "handle"}},
}
}
Expand Down

0 comments on commit 7e82dde

Please sign in to comment.