def test_div_int_string(self): with self.assertRaises(TypeError): calculator.calc_div(10, "string")
def test_div_int_float(self): self.assertEqual(calculator.calc_div(10,0.5), 20)
def test_div_pos_neg(self): self.assertEqual(calculator.calc_div(10,-2), -5)
def test_div_by_zero(self): with self.assertRaises(ZeroDivisionError): calculator.calc_div(1,0)
def test_div_pos(self): self.assertEqual(calculator.calc_div(10,2), 5)