Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
HansKallekleiv committed Sep 2, 2024
1 parent 58f7d30 commit 312b08c
Showing 1 changed file with 38 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,42 @@ async def test_get_vector_list(test_user, sumo_test_ensemble_ahm):
res = client.post("/search", json={})

response = await client.post_async("/search", json={})
assert 1 == 1
vector_list = await router.get_vector_list(
None, user, sumo_test_ensemble_ahm.case_uuid, sumo_test_ensemble_ahm.ensemble_name
)
query_dict = {
"bool": {
"must": [
{"term": {"class": "table"}},
{"term": {"_sumo.parent_object.keyword": "485041ce-ad72-48a3-ac8c-484c0ed95cf8"}},
{"term": {"fmu.iteration.name.keyword": "iter-0"}},
{"term": {"fmu.context.stage.keyword": "iteration"}},
{"term": {"fmu.aggregation.operation.keyword": "collection"}},
{"term": {"data.tagname.keyword": "summary"}},
{"term": {"data.content.keyword": "timeseries"}},
],
}
}

search_payload = {
"track_total_hits": True,
"query": query_dict,
"aggs": {
"smry_tables": {
"terms": {"field": "data.name.keyword"},
"aggs": {
"smry_columns": {
"terms": {"field": "data.spec.columns.keyword", "size": 65535},
},
},
},
},
"_source": False,
"size": 0,
}

response = await client.post_async("/search", json=search_payload)
assert response.status_code == 200
# vector_list = await router.get_vector_list(
# None, user, sumo_test_ensemble_ahm.case_uuid, sumo_test_ensemble_ahm.ensemble_name
# )

assert len(vector_list) == 786
assert isinstance(vector_list[0], schemas.VectorDescription)
# assert len(vector_list) == 786
# assert isinstance(vector_list[0], schemas.VectorDescription)

0 comments on commit 312b08c

Please sign in to comment.