def test_if_simplify_correctly(self): fraction = (3, 9) result = simplify_fraction_func(fraction) self.assertEqual(result, (1, 3))
def test_if_all_arguments_are_simplified(self): fractions = [(1, 3), (1, 4), (3, 7)] temp_list = [] for fraction in fractions: temp_elem = simplify_fraction_func(fraction) temp_list.append(temp_elem) self.assertEqual(fractions, temp_list)
def test_if_denominator_is_zero_raise_error(self): fraction = (3, 9) fraction = simplify_fraction_func(fraction) flag = False if fraction[1] == 0: flag = True self.assertFalse(flag)