def test_dict(self): result = target_stitch.float_to_decimal({'float': 1.2, 'str': 'hi'}) self.assertTrue(isinstance(result['float'], Decimal)) self.assertTrue(isinstance(result['str'], str))
def test_scalar_non_float(self): self.assertTrue(isinstance(target_stitch.float_to_decimal('hi'), str))
def test_array(self): result = target_stitch.float_to_decimal([1.2, 'hi']) self.assertTrue(isinstance(result[0], Decimal)) self.assertTrue(isinstance(result[1], str))
def test_scalar_float(self): self.assertTrue( isinstance(target_stitch.float_to_decimal(1.2), Decimal))