Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
relud committed Oct 9, 2024
1 parent 9ac223f commit b360970
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions socorro/external/es/supersearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ def get_indices(self, dates):

def format_field_names(self, hit):
"""Return hit with field's search_key replaced with name"""
if not hit.keys():
return {}

# unnest hit one level and update keys
namespace = one(hit)
hit = {f"{namespace}.{key}": item for key, item in hit[namespace].items()}
hit = {
f"{namespace}.{key}": item
for namespace in hit
for key, item in hit[namespace].items()
}

new_hit = {}
for field_name in self.request_columns:
Expand Down
3 changes: 2 additions & 1 deletion socorro/tests/external/es/test_supersearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@ def test_get_with_bool_operators(self, es_helper):

assert resp["total"] == 2
assert len(resp["hits"]) == 2
assert not resp["hits"][0]["accessibility"]
for hit in resp["hits"]:
assert not hit["accessibility"]

def test_get_with_combined_operators(self, es_helper):
now = utc_now()
Expand Down

0 comments on commit b360970

Please sign in to comment.