예제 #1
0
 def test_gcd_two_positive_integers(self):
     self.assertEqual(36, q02.gcd(36, 72))
예제 #2
0
 def test_gcd_first_argument_positive_second_argument_negative_integer(
         self):
     self.assertEqual(36, q02.gcd(36, -72))
예제 #3
0
 def test_gcd_two_zeros(self):
     with self.assertRaises(ValueError):
         q02.gcd(0, 0)
예제 #4
0
 def test_gcd_first_argument_zero_second_argument_negative(self):
     self.assertEqual(72, q02.gcd(0, -72))
예제 #5
0
 def test_gcd_first_argument_negative_second_argument_zero(self):
     self.assertEqual(-72, q02.gcd(-72, 0))
예제 #6
0
 def test_gcd_first_argument_positive_second_argument_zero(self):
     self.assertEqual(72, q02.gcd(72, 0))
예제 #7
0
 def test_gcd_two_negative_integers(self):
     self.assertEqual(36, q02.gcd(-72, -36))