def test_mixed_number(self):
     self.assertEqual(fractions.Fraction(5, 4),
                      quantity_to_fraction('1 1/4'))
     self.assertEqual(fractions.Fraction(5, 4),
                      quantity_to_fraction('1 and 1/4'))
     self.assertEqual(fractions.Fraction(5, 4),
                      quantity_to_fraction('1-1/4'))
 def test_negative_numbers(self):
     self.assertEqual(fractions.Fraction(-5, 4),
                      quantity_to_fraction('-1 1/4'))
     self.assertEqual(fractions.Fraction(-5, 4),
                      quantity_to_fraction('-1-1/4'))
     self.assertEqual(fractions.Fraction(-5, 4),
                      quantity_to_fraction('-1 - 1/4'))
     self.assertEqual(fractions.Fraction(-5, 4),
                      quantity_to_fraction('-1 and 1/4'))
 def test_negative_numbers(self):
     self.assertEqual(fractions.Fraction(-5, 4), quantity_to_fraction('-1 1/4'))
     self.assertEqual(fractions.Fraction(-5, 4), quantity_to_fraction('-1-1/4'))
     self.assertEqual(fractions.Fraction(-5, 4), quantity_to_fraction('-1 - 1/4'))
     self.assertEqual(fractions.Fraction(-5, 4), quantity_to_fraction('-1 and 1/4'))
 def test_mixed_number(self):
     self.assertEqual(fractions.Fraction(5, 4), quantity_to_fraction('1 1/4'))
     self.assertEqual(fractions.Fraction(5, 4), quantity_to_fraction('1 and 1/4'))
     self.assertEqual(fractions.Fraction(5, 4), quantity_to_fraction('1-1/4'))
 def test_simple_fraction(self):
     self.assertEqual(fractions.Fraction(1, 4), quantity_to_fraction('1/4'))
     self.assertEqual(fractions.Fraction(1, 3), quantity_to_fraction('1/3'))
     self.assertEqual(fractions.Fraction(3, 2), quantity_to_fraction('3/2'))
 def test_simple_decimal(self):
     self.assertEqual(fractions.Fraction(1, 4), quantity_to_fraction('.25'))
     self.assertEqual(fractions.Fraction(5, 4), quantity_to_fraction('1.25'))
 def test_single_integer(self):
     self.assertEqual(fractions.Fraction(1, 1), quantity_to_fraction('1'))
     self.assertEqual(fractions.Fraction(2, 1), quantity_to_fraction('2'))
 def test_simple_fraction(self):
     self.assertEqual(fractions.Fraction(1, 4), quantity_to_fraction('1/4'))
     self.assertEqual(fractions.Fraction(1, 3), quantity_to_fraction('1/3'))
     self.assertEqual(fractions.Fraction(3, 2), quantity_to_fraction('3/2'))
 def test_simple_decimal(self):
     self.assertEqual(fractions.Fraction(1, 4), quantity_to_fraction('.25'))
     self.assertEqual(fractions.Fraction(5, 4),
                      quantity_to_fraction('1.25'))
 def test_single_integer(self):
     self.assertEqual(fractions.Fraction(1, 1), quantity_to_fraction('1'))
     self.assertEqual(fractions.Fraction(2, 1), quantity_to_fraction('2'))