示例#1
0
 def test_zero_division(self):
     with self.assertRaises(ZeroDivisionError):
         Calculator.quotient(30, 0)
示例#2
0
 def test_divide_result_type(self):
     self.assertIsInstance(Calculator.quotient(30, 5), float)
     self.assertIsInstance(Calculator.quotient(15, 5), float)
     self.assertIsInstance(Calculator.quotient(34, 10), float)
示例#3
0
 def test_divide_non_int_type(self):
     with self.assertRaises(TypeError):
         Calculator.quotient(30, "r")
示例#4
0
 def test_divide_result(self):
     self.assertEqual(Calculator.quotient(30, 5), 6)
     self.assertEqual(Calculator.quotient(15, 5), 3)
     self.assertEqual(Calculator.quotient(20, 2), 10)