def test_from_stream(self): ae = self.assertEqual data_le = b"\x4C\x27\xF6\xFF\xFF\xFF\xFF\xFF" data_be = data_le[::-1] value_le = CURRENCYToDecimal.from_stream(ByteIStream(data_le), byte_order=LITTLE_ENDIAN) value_be = CURRENCYToDecimal.from_stream(ByteIStream(data_be), byte_order=BIG_ENDIAN) value = Decimal("-64.53") ae(value_le, value) ae(value_be, value)
def test_from_int(self): ae = self.assertEqual ae(CURRENCYToDecimal.from_int(-645300), Decimal("-64.53"))