diff options
author | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2013-10-29 00:40:51 +0100 |
---|---|---|
committer | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2013-10-29 00:40:51 +0100 |
commit | cea04334adfa5ac1458465dcf7f76aa8ee2ed425 (patch) | |
tree | 84b27a7a5abbdb30a1ac8b8b9ce707d52ad8cf36 /tests | |
parent | 5fc87aaa492abe596a8ced0e23ba23b8c97252e8 (diff) | |
download | factory-boy-cea04334adfa5ac1458465dcf7f76aa8ee2ed425.tar factory-boy-cea04334adfa5ac1458465dcf7f76aa8ee2ed425.tar.gz |
Fix FuzzyDecimal tests.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_fuzzy.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_fuzzy.py b/tests/test_fuzzy.py index b97f4bd..050f8a1 100644 --- a/tests/test_fuzzy.py +++ b/tests/test_fuzzy.py @@ -115,17 +115,17 @@ class FuzzyDecimalTestCase(unittest.TestCase): fuzz = fuzzy.FuzzyDecimal(2.0, 3.0) for _i in range(20): res = fuzz.evaluate(2, None, False) - self.assertTrue(decimal.Decimal(2.0) <= res <= Decimal(3.0), 'value is not between 2.0 and 3.0. It is %d' % res) + self.assertTrue(decimal.Decimal(2.0) <= res <= decimal.Decimal(3.0), 'value is not between 2.0 and 3.0. It is %d' % res) fuzz = fuzzy.FuzzyDecimal(4.0) for _i in range(20): res = fuzz.evaluate(2, None, False) - self.assertTrue(decimal.Decimal(0.0) <= res <= Decimal(4.0), 'value is not between 0.0 and 4.0. It is %d' % res) + self.assertTrue(decimal.Decimal(0.0) <= res <= decimal.Decimal(4.0), 'value is not between 0.0 and 4.0. It is %d' % res) fuzz = fuzzy.FuzzyDecimal(1.0, 4.0, precision=5) for _i in range(20): res = fuzz.evaluate(2, None, False) - self.assertTrue(decimal.Decimal(0.54) <= res <= Decimal(4.0), 'value is not between 0.54 and 4.0. It is %d' % res) + self.assertTrue(decimal.Decimal(0.54) <= res <= decimal.Decimal(4.0), 'value is not between 0.54 and 4.0. It is %d' % res) self.assertTrue(res.as_tuple().exponent, -5) def test_biased(self): @@ -156,7 +156,7 @@ class FuzzyDecimalTestCase(unittest.TestCase): with mock.patch('random.uniform', fake_uniform): res = fuzz.evaluate(2, None, False) - self.assertEqual(decimal.Decimal(8.001).quantize(Decimal(10) ** -3), res) + self.assertEqual(decimal.Decimal(8.001).quantize(decimal.Decimal(10) ** -3), res) class FuzzyDateTestCase(unittest.TestCase): |