Skip to content

Commit

Permalink
TST: fixed error messages for Pydantic 1
Browse files Browse the repository at this point in the history
  • Loading branch information
dmgav committed Feb 13, 2024
1 parent bff3ab1 commit 0c9d7a7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions bluesky_queueserver/manager/tests/test_profile_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -7063,10 +7063,10 @@ def _vp3b(
else:
err_msg_tvp3a = "value is not a valid enumeration member; permitted: 'm2'"
err_msg_tvp3b = "value is not a valid enumeration member; permitted: 'm2'"
err_msg_tvp3c = "value is not a valid enumeration member; permitted:"
err_msg_tvp3d = "value is not a valid enumeration member; permitted:"
err_msg_tvp3c = "has no members defined (type=type_error)"
err_msg_tvp3d = "has no members defined (type=type_error)"
err_msg_tvp3e = "value is not a valid list"
err_msg_tvp3f = "value is not a valid enumeration member; permitted:"
err_msg_tvp3f = "has no members defined (type=type_error)"
err_msg_tvp3f1 = "value is not a valid enumeration member; permitted:"
err_msg_tvp3g = "value is not a valid list"
err_msg_tvp3h = "value is not a valid enumeration member; permitted: 'd1', 'd2'"
Expand Down Expand Up @@ -7108,6 +7108,12 @@ def _vp3b(
# Both motors are not in the list of allowed devices.
(_vp3a, {"args": [("m1", "m2"), ("d1", "d2"), ("p1",), (10.0, 20.0)], "kwargs": {}},
("m4", "m5", "d1", "d2"), False, err_msg_tvp3c),
# The list of motors is empty, but validation succeeds, since no motors are passed
(_vp3a, {"args": [tuple(), ("d1", "d2"), ("p1",), (10.0, 20.0)], "kwargs": {}},
("d1", "d2"), True, ""),
# Same, but there are some non-existing motors in the list of allowed devices
(_vp3a, {"args": [tuple(), ("d1", "d2"), ("p1",), (10.0, 20.0)], "kwargs": {}},
("m4", "m5", "d1", "d2"), True, ""),
# Empty list of allowed devices (should be the same result as above).
(_vp3a, {"args": [("m1", "m2"), ("d1", "d2"), ("p1",), (10.0, 20.0)], "kwargs": {}},
(), False, err_msg_tvp3d),
Expand Down

0 comments on commit 0c9d7a7

Please sign in to comment.