def test_from_float_with_various_valid_inputs_returns_expected_decimal( self, value, precision, expected): # Arrange # Act price = Price.from_float(value, precision) # Assert self.assertEqual(expected, price)
def test_repr(self): # Arrange price = Price.from_float(1.00000, 5) # Act result = repr(price) print(repr(price)) # Assert self.assertTrue(result.startswith("<Price('1.00000') object at"))
def make_price_from_float(): Price.from_float(1.23456, 5)