def test_decode_decimal_value_data_type(self): value = b'\x05\x00\x04\xcb/' self.assertIsInstance(decode.decimal(value)[1], decimal.Decimal)
def test_decode_decimal_value(self): value = b'\x05\x00\x04\xcb/' self.assertEqual(round(float(decode.decimal(value)[1]), 5), round(float(decimal.Decimal('3.14159')), 5))
def test_decode_decimal_value_bytes_consumed(self): value = b'\x05\x00\x04\xcb/' self.assertEqual(decode.decimal(value)[0], len(value))