コード例 #1
0
ファイル: test_protocol.py プロジェクト: swipswaps/gofer
    def test_call(self):
        code = 18
        payload = 1234
        target = Mock()
        Reply.register(code, target)

        # test
        reply = Reply(code, payload)
        reply()

        # validation
        target.assert_called_once_with(payload)
        target.return_value.assert_called_once_with()
コード例 #2
0
    def test_call(self):
        code = 18
        payload = 1234
        target = Mock()
        Reply.register(code, target)

        # test
        reply = Reply(code, payload)
        reply()

        # validation
        target.assert_called_once_with(payload)
        target.return_value.assert_called_once_with()
コード例 #3
0
ファイル: test_protocol.py プロジェクト: swipswaps/gofer
 def test_register(self):
     code = 18
     target = Mock()
     Reply.register(code, target)
     self.assertEqual(Reply.registry[code], target)
コード例 #4
0
ファイル: test_protocol.py プロジェクト: swipswaps/gofer
 def test_call_not_found(self):
     reply = Reply(44, '')
     reply()
コード例 #5
0
 def test_register(self):
     code = 18
     target = Mock()
     Reply.register(code, target)
     self.assertEqual(Reply.registry[code], target)