6
6
from simple_rpc .cli import _describe_method , rpc_call , rpc_list
7
7
from simple_rpc .extras import json_utf8_decode , json_utf8_encode
8
8
9
- from conf import _devices , _interface
9
+ from . conf import _devices , _interface
10
10
11
11
12
12
def test_json_utf8_encode () -> None :
@@ -36,7 +36,7 @@ def test_describe_method() -> None:
36
36
def test_rpc_list () -> None :
37
37
handle = StringIO ()
38
38
39
- rpc_list (handle , _devices ['serial' ], 9600 , 1 , None )
39
+ rpc_list (handle , _devices ['serial' ], 9600 , 2 , None )
40
40
assert 'ping data\n Echo a value.\n ' in handle .getvalue ()
41
41
42
42
@@ -45,7 +45,7 @@ def test_rpc_list_save() -> None:
45
45
handle = StringIO ()
46
46
iface_handle = StringIO ()
47
47
48
- rpc_list (handle , _devices ['serial' ], 9600 , 1 , iface_handle )
48
+ rpc_list (handle , _devices ['serial' ], 9600 , 2 , iface_handle )
49
49
iface_handle .seek (0 )
50
50
device = load (iface_handle , Loader = FullLoader )
51
51
assert device ['methods' ]['ping' ]['doc' ] == 'Echo a value.'
@@ -55,7 +55,7 @@ def test_rpc_list_save() -> None:
55
55
def test_rpc_call () -> None :
56
56
handle = StringIO ()
57
57
58
- rpc_call (handle , _devices ['serial' ], 9600 , 1 , None , 'ping' , ['10' ])
58
+ rpc_call (handle , _devices ['serial' ], 9600 , 2 , None , 'ping' , ['10' ])
59
59
assert handle .getvalue () == '10\n '
60
60
61
61
@@ -65,7 +65,7 @@ def test_rpc_call_load() -> None:
65
65
iface_handle = StringIO (_interface )
66
66
67
67
rpc_call (
68
- handle , _devices ['serial' ], 9600 , 1 , iface_handle , 'ping' , ['10' ])
68
+ handle , _devices ['serial' ], 9600 , 2 , iface_handle , 'ping' , ['10' ])
69
69
assert handle .getvalue () == '10\n '
70
70
71
71
@@ -76,7 +76,7 @@ def test_rpc_call_load_() -> None:
76
76
77
77
try :
78
78
rpc_call (
79
- handle , _devices ['serial' ], 9600 , 1 , iface_handle , 'inc' , ['1' ])
79
+ handle , _devices ['serial' ], 9600 , 2 , iface_handle , 'inc' , ['1' ])
80
80
except ValueError as error :
81
81
assert str (error ) == 'invalid method name: inc'
82
82
else :
0 commit comments