Skip to content

Commit a5df3f1

Browse files
committed
Fix server tests
1 parent 9a56d6c commit a5df3f1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/test_server.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class TestServerOperation:
1414
def test_add_device(self) -> None:
1515
device = step400.STEP400(0)
1616
assert server.DEFAULT_SERVER._bound_devices[-1][0] == device
17-
assert server.DEFAULT_SERVER._bound_devices[-1][-1] is None
17+
assert server.DEFAULT_SERVER._bound_devices[-1][-1] is not None
1818

1919
device2 = step400.STEP400(0, "10.1.21.56")
2020
assert server.DEFAULT_SERVER._bound_devices[-1][0] == device2
@@ -25,19 +25,19 @@ def test_add_device(self) -> None:
2525
assert server.DEFAULT_SERVER._bound_devices[-1][-1] is not None
2626

2727
def test_remove_device(self) -> None:
28-
device = step400.STEP400(0)
2928
length = len(server.DEFAULT_SERVER._bound_devices)
30-
assert length > 1
29+
device = step400.STEP400(0)
30+
assert len(server.DEFAULT_SERVER._bound_devices) > length
3131

3232
server.DEFAULT_SERVER.remove_device(device)
33-
assert (length - len(server.DEFAULT_SERVER._bound_devices)) == 1
33+
assert len(server.DEFAULT_SERVER._bound_devices) == length
3434

3535
def test_shutdown(self) -> None:
3636
server.DEFAULT_SERVER.shutdown()
3737
assert len(server.DEFAULT_SERVER._bound_devices) == 0
3838

3939
def test_send_errors(self) -> None:
40-
with pytest.raises(exceptions.ClientNotFoundError):
40+
with pytest.raises(exceptions.ClientClosedError):
4141
device = step400.STEP400(0)
4242
server.DEFAULT_SERVER.remove_device(device)
4343
device.get(commands.GetVersion())

0 commit comments

Comments
 (0)