'Test decoding of a payload'

def test_decode_payload(self):

    message = MockObject()
    meta_msg = self.market_community.get_meta_message(u'ask')
    offer_payload = OfferPayload.Implementation(meta_msg, TraderId('abc'), MessageNumber('3'), OrderNumber(4), Price(5, 'BTC'), Quantity(6, 'MC'), Timeout(3600), Timestamp.now(), 'a', 'b', Ttl(3), '1.2.3.4', 1234)
    message.payload = offer_payload
    packet = encode((3.14, 100))
    placeholder = self.get_placeholder_msg(u'ask')
    self.assertRaises(DropPacket, self.conversion._decode_payload, placeholder, 0, packet, [Price])
    self.assertRaises(DropPacket, self.conversion._decode_payload, placeholder, 0, 'a2zz', [Price])
