def test_zero_division(self): with self.assertRaises(ZeroDivisionError): Calculator.quotient(30, 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)
def test_divide_non_int_type(self): with self.assertRaises(TypeError): Calculator.quotient(30, "r")
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)