Skip to content

Commit c89f3cf

Browse files
author
Rose Yemelyanova
committed
modified tests to pass and added component checking for message of add u/ub response
1 parent 1ee874b commit c89f3cf

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tests/test_ubcalc.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,13 @@ def test_set_u():
381381
client = Client(hkl).client
382382

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

386386
assert np.all(ubcalc.U == u_matrix)
387+
assert (
388+
literal_eval(response.content.decode())["message"]
389+
== "U matrix set for crystal test of collection B07"
390+
)
387391

388392

389393
def test_set_ub():
@@ -392,9 +396,13 @@ def test_set_ub():
392396
client = Client(hkl).client
393397

394398
ub_matrix = np.identity(3)
395-
client.put("/ub/test/ub?collection=B07", json=ub_matrix.tolist())
399+
response = client.put("/ub/test/ub?collection=B07", json=ub_matrix.tolist())
396400

397-
assert np.all(ubcalc.U == ub_matrix)
401+
assert np.all(ubcalc.UB == ub_matrix)
402+
assert (
403+
literal_eval(response.content.decode())["message"]
404+
== "UB matrix set for crystal test of collection B07"
405+
)
398406

399407

400408
def test_modify_property():

0 commit comments

Comments
 (0)