Exemple #1
0
    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)
Exemple #2
0
    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)