def test_subscriber_connection(self): proto = SubscriberProtocol("test", lambda _: None) proto.makeConnection(MagicMock()) proto.connectionMade() proto.transport.write.assert_called_with(make_subscribe_request("test"))
def test_subscriber_received(self): callmock = MagicMock() proto = SubscriberProtocol("test", callmock) proto.makeConnection(MagicMock()) proto.dataReceived(json.dumps({"testdata": 5})) callmock.assert_called_with(testdata=5)
def test_subscriber_received(self): callmock = MagicMock() proto = SubscriberProtocol('test', callmock) proto.makeConnection(MagicMock()) proto.dataReceived(json.dumps({'testdata': 5})) callmock.assert_called_with(testdata=5)
def test_subscriber_connection(self): proto = SubscriberProtocol('test', lambda _: None) proto.makeConnection(MagicMock()) proto.connectionMade() proto.transport.write.assert_called_with( make_subscribe_request('test'))