Beispiel #1
0
    def test_init(self):
        mock(connection, 'super')
        with expect(connection, 'super').args(is_arg(ConnectionChannel), ConnectionChannel).returns(mock()) as s:
            expect(s.__init__).args('a', 'b')

        c = ConnectionChannel('a', 'b')
        assert_equals(c._method_map,
                      {
                          10: c._recv_start,
                          20: c._recv_secure,
                          30: c._recv_tune,
                          41: c._recv_open_ok,
                          50: c._recv_close,
                          51: c._recv_close_ok,
                      }
                      )
        assert_equal(0, c._last_heartbeat_send)
Beispiel #2
0
 def setUp(self):
     super(ConnectionChannelTest, self).setUp()
     self.connection = mock()
     self.ch = ConnectionChannel(self.connection, 0, {})