@@ -11,6 +11,9 @@ def test_call(self):
1111 def test_call2 (self ):
1212 self .call ("testCall2" )
1313
14+ def test_call3 (self ):
15+ self .call ("testCall3" , "hello" )
16+
1417
1518FAKE_CALLS_COMPONENT_URL = "/message/tests.views.message.test_calls.FakeCallsComponent"
1619
@@ -25,7 +28,7 @@ def test_message_calls(client):
2528 )
2629
2730 body = response .json ()
28- assert body .get ("calls" ) == [{"fn" : "testCall" }]
31+ assert body .get ("calls" ) == [{"args" : [], " fn" : "testCall" }]
2932
3033
3134def test_message_multiple_calls (client ):
@@ -38,4 +41,20 @@ def test_message_multiple_calls(client):
3841 )
3942
4043 body = response .json ()
41- assert body .get ("calls" ) == [{"fn" : "testCall" }, {"fn" : "testCall2" }]
44+ assert body .get ("calls" ) == [
45+ {"args" : [], "fn" : "testCall" },
46+ {"args" : [], "fn" : "testCall2" },
47+ ]
48+
49+
50+ def test_message_calls_with_arg (client ):
51+ action_queue = [
52+ {"payload" : {"name" : "test_call3" }, "type" : "callMethod" , "target" : None ,}
53+ ]
54+
55+ response = post_and_get_response (
56+ client , url = FAKE_CALLS_COMPONENT_URL , action_queue = action_queue
57+ )
58+
59+ body = response .json ()
60+ assert body .get ("calls" ) == [{"args" : ["hello" ], "fn" : "testCall3" }]
0 commit comments