We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ceb227f commit 9f8e635Copy full SHA for 9f8e635
tests/test_core_exceptions.py
@@ -0,0 +1,26 @@
1
+from labthings.core import exceptions
2
+import pytest
3
+
4
5
+def test_lockerror_valid_code():
6
+ from threading import Lock
7
8
+ lock = Lock()
9
10
+ assert exceptions.LockError("ACQUIRE_ERROR", lock)
11
+ assert (
12
+ str(exceptions.LockError("ACQUIRE_ERROR", lock))
13
+ == f"ACQUIRE_ERROR: LOCK {lock}: Unable to acquire. Lock in use by another thread."
14
+ )
15
16
17
+def test_lockerror_invalid_code():
18
19
20
21
22
+ assert exceptions.LockError("INVALID_ERROR", lock)
23
24
+ str(exceptions.LockError("INVALID_ERROR", lock))
25
+ == f"INVALID_ERROR: LOCK {lock}: Unknown error."
26
0 commit comments