@@ -14,7 +14,7 @@ class TestServerOperation:
14
14
def test_add_device (self ) -> None :
15
15
device = step400 .STEP400 (0 )
16
16
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
18
18
19
19
device2 = step400 .STEP400 (0 , "10.1.21.56" )
20
20
assert server .DEFAULT_SERVER ._bound_devices [- 1 ][0 ] == device2
@@ -25,19 +25,19 @@ def test_add_device(self) -> None:
25
25
assert server .DEFAULT_SERVER ._bound_devices [- 1 ][- 1 ] is not None
26
26
27
27
def test_remove_device (self ) -> None :
28
- device = step400 .STEP400 (0 )
29
28
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
31
31
32
32
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
34
34
35
35
def test_shutdown (self ) -> None :
36
36
server .DEFAULT_SERVER .shutdown ()
37
37
assert len (server .DEFAULT_SERVER ._bound_devices ) == 0
38
38
39
39
def test_send_errors (self ) -> None :
40
- with pytest .raises (exceptions .ClientNotFoundError ):
40
+ with pytest .raises (exceptions .ClientClosedError ):
41
41
device = step400 .STEP400 (0 )
42
42
server .DEFAULT_SERVER .remove_device (device )
43
43
device .get (commands .GetVersion ())
0 commit comments