def test_rational_number_isub(self, r1, r2): """test __isub__ method for Rational objects""" r1 = Rational(1, 8) r1 -= r2 assert r1.__str__() == "-1/8"
def test_rational_number_imul(self, r1, r2): """test __imul__ method for Rational objects""" r1 = Rational(1, 8) r1 *= r2 assert r1.__str__() == "1/32"
def test_rational_number_iadd(self, r1, r2): """test __iadd__ method for Rational objects""" r1 = Rational(1, 8) r1 += r2 assert r1.__str__() == "3/8"