File tree Expand file tree Collapse file tree 1 file changed +26
-5
lines changed Expand file tree Collapse file tree 1 file changed +26
-5
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,33 @@ def test_dispatch_serializer():
1818
1919def test_serialize_message_not_dataclass ():
2020 bh = _BusinessHost ()
21- msg = TestSimpleMessageNotDataclass (integer = 1 , string = 'test' )
22- result = bh ._serialize_message (msg )
23- result .jstr .Rewind ()
24- stream = result .jstr .Read ()
25- assert result .classname == 'registerFiles.message.TestSimpleMessageNotDataclass'
21+ msg = TestSimpleMessageNotDataclass ()
22+ msg .integer = 1
23+ msg .string = 'test'
24+
25+ # Mock iris_handler
26+ bh .iris_handle = MagicMock ()
27+
28+ # expect an error
29+ try :
30+ bh .send_request_sync (target = 'test' , request = msg )
31+ except Exception as e :
32+ assert type (e ) == TypeError
33+
34+ def test_serialize_message_not_message ():
35+ bh = _BusinessHost ()
36+ msg = TestSimpleMessageNotMessage ()
37+ msg .integer = 1
38+ msg .string = 'test'
39+
40+ # Mock iris_handler
41+ bh .iris_handle = MagicMock ()
2642
43+ # expect an error
44+ try :
45+ bh .send_request_sync (target = 'test' , request = msg )
46+ except Exception as e :
47+ assert type (e ) == TypeError
2748
2849def test_serialize_message_decorator ():
2950 bh = _BusinessHost ()
You can’t perform that action at this time.
0 commit comments