コード例 #1
0
    def test_fraction_is_simplified_as_expected(self):
        fraction = Fraction(10, 50)

        expected = Fraction(1, 5)

        self.assertEqual(fraction.simplify(), expected)
コード例 #2
0
    def test_simplified_fraction_is_preserved_after_simplication(self):
        fraction = Fraction(1, 5)
        expected = Fraction(1, 5)

        self.assertEqual(fraction.simplify(), expected)