Skip to content

Commit

Permalink
modified tests to pass and added component checking for message of ad…
Browse files Browse the repository at this point in the history
…d u/ub response
  • Loading branch information
Rose Yemelyanova committed Nov 11, 2022
1 parent 1ee874b commit c89f3cf
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/test_ubcalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,13 @@ def test_set_u():
client = Client(hkl).client

u_matrix = np.identity(3)
client.put("/ub/test/u?collection=B07", json=u_matrix.tolist())
response = client.put("/ub/test/u?collection=B07", json=u_matrix.tolist())

assert np.all(ubcalc.U == u_matrix)
assert (
literal_eval(response.content.decode())["message"]
== "U matrix set for crystal test of collection B07"
)


def test_set_ub():
Expand All @@ -392,9 +396,13 @@ def test_set_ub():
client = Client(hkl).client

ub_matrix = np.identity(3)
client.put("/ub/test/ub?collection=B07", json=ub_matrix.tolist())
response = client.put("/ub/test/ub?collection=B07", json=ub_matrix.tolist())

assert np.all(ubcalc.U == ub_matrix)
assert np.all(ubcalc.UB == ub_matrix)
assert (
literal_eval(response.content.decode())["message"]
== "UB matrix set for crystal test of collection B07"
)


def test_modify_property():
Expand Down

0 comments on commit c89f3cf

Please sign in to comment.