Skip to content

Commit

Permalink
Fix mock opensearch tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliottKasoar committed Jun 12, 2024
1 parent 1a386b6 commit 3826c10
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions tests/test_opensearch_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,9 @@ def test_push(self, abcd):
assert isinstance(atoms_2, Atoms)
atoms_2.set_cell([1, 1, 1])

abcd.refresh()
result = AtomsModel(
None,
None,
abcd.client.search(index="test_index")["hits"]["hits"][0]["_source"],
dict=abcd.client.search(index="test_index")["hits"]["hits"][0]["_source"],
).to_ase()
assert atoms_1 == result
assert atoms_2 != result
Expand Down Expand Up @@ -120,14 +119,10 @@ def test_bulk(self, abcd):
assert abcd.count() == 2

result_1 = AtomsModel(
None,
None,
abcd.client.search(index="test_index")["hits"]["hits"][0]["_source"],
dict=abcd.client.search(index="test_index")["hits"]["hits"][0]["_source"],
).to_ase()
result_2 = AtomsModel(
None,
None,
abcd.client.search(index="test_index")["hits"]["hits"][1]["_source"],
dict=abcd.client.search(index="test_index")["hits"]["hits"][1]["_source"],
).to_ase()
assert atoms_1 == result_1
assert atoms_2 == result_2
Expand Down

0 comments on commit 3826c10

Please sign in to comment.