def test_gcd_zero(self): self.assertEqual(gcd(0, 0), 0)
def test_gcd_evens(self): self.assertEqual(gcd(2, 10), 2)
def test_gcd_zero_type(self): self.assertIsInstance(gcd(8, 10), int)
def test_gcd_zero_a(self): self.assertEqual(gcd(101, 0), 101)
def test_gcd_primes(self): self.assertEqual(gcd(11, 7), 1)
def test_gcd_result_is_divisor_of_both_arguments(self): result = gcd(120, 45) self.assertTrue(120 % result == 0 and 45 % result == 0)
def test_gcd_zero_b(self): self.assertEqual(gcd(0, 9), 9)
def test_gcd_pass_0_as_argument_b(self): with self.assertRaises(ValueError): gcd(125, 0)
def test_gcd_return_type(self): self.assertIsInstance(gcd(120, 45), int)
def test_gcd_with_both_negative_arguments(self): self.assertEqual(gcd(-36, -99), -9)
def test_gcd_with_one_negative_argument(self): self.assertEqual(gcd(-184, 98), 2)
def test_gcd_zeroes(self): with self.assertRaises(ValueError): q02.gcd(0, 0)
def test_gcd_argument_zero(self): self.assertEqual(12, q02.gcd(0, 12))
def test_gcd_negatives(self): self.assertEqual(4, q02.gcd(-4, -12))
def test_gcd_first_negative_positive(self): self.assertEqual(4, q02.gcd(-4, 12))
def test_gcd_positives(self): self.assertEqual(4, q02.gcd(4, 12))