def test_encode_message(self):
    Message.add_encoder(Cryptor())
    msg = factory.MessageFactory.create()
    inp = {'event': 'channel.on', 'parameters': {'channel': 0}, 'response': '', 'targets': ['node-north']}
    msg.set(inp)
    msg.encrypt()
    assert_equal(inp['event'], msg.data['event'])
    assert_equal(inp['parameters'], msg.data['parameters'])
    assert_equal(inp['targets'], msg.data['targets'])
def test_encode_message(self):
    Message.add_encoder(Cryptor())
    msg = factory.MessageFactory.create()
    inp = {'event': 'channel.on', 'parameters': {'channel': 0}, 'response': , 'targets': ['node-north']}
    msg.set(inp)
    msg.encrypt()
    assert_equal(inp['event'], msg.data['event'])
    assert_equal(inp['parameters'], msg.data['parameters'])
    assert_equal(inp['targets'], msg.data['targets'])