def test_can_add_fractions_from_package(self): """ Special test that checks that we can use the installed version of the package RUN THIS TEST WIHTOUT THE LOCAL tdd_fractions MODULE IN THE PYTHON SEARCH PATH """ self.assertEqual( tdd_fractions.add(tdd_fractions.Fraction(7, 4), tdd_fractions.Fraction(4, 5)), tdd_fractions.Fraction(51, 20))
def test_one_plus_zero_equals_one(self): self.assertEqual(add(0, 1), 1)
def test_zero_plus_zero_equals_zero(self): self.assertEqual(add(0, 0), 0)
def test_one_fourth_plus_one_fourth_equals_one_half(self): self.assertEqual(Fraction(1, 2), add(Fraction(1, 4), Fraction(1, 4)))
def test_one_fifth_plus_one_sixth_equals_eleven_on_thirty(self): self.assertEqual(Fraction(11, 30), add(Fraction(1, 5), Fraction(1, 6)))
def test_two_fifths_plus_two_equals_thriteen_fifths(self): self.assertEqual(add(Fraction(2, 5), 2), Fraction(12, 5))
def test_one_plus_one_half_equals_two_halves(self): self.assertEqual(add(1, Fraction(1, 2)), Fraction(3, 2))