Пример #1
0
 def test_execute_the_remote_module_send(self):
     stub_channel = Factory(send=Capture(), receive=Capture())
     self.conn.gateway.channel = self.conn.gateway
     remote_foo = self.conn.import_module(fake_module)
     remote_foo.channel = stub_channel
     remote_foo.function('argument')
     assert stub_channel.send.calls[0]['args'][0] == "function('argument')"
Пример #2
0
 def test_execute_the_remote_module_receive(self):
     stub_channel = Factory(receive=Capture(return_values=[True]),
                            send=Capture())
     self.conn.gateway.channel = self.conn.gateway
     remote_foo = self.conn.import_module(fake_module)
     remote_foo.channel = stub_channel
     assert remote_foo.function('argument') is True