def test_add(self): try: c = Calculator(2,4) result = c.add() assert(result == 6),'Integer addition result error!' except AssertionError as msg: print(msg) else: print('test pass!')
def setUp(self): self.cal = Calculator(8, 4)
def test_add(self): c = Calculator(2, 4) result = c.add() self.assertEqual(result, 6)
def test_div(self): c = Calculator(8, 3) result = c.div() self.assertNotEqual(result, 999)
def test_mul(self): c = Calculator(2, 4) result = c.mul() self.assertEqual(result, 8)
def test_sub(self): c = Calculator(8, 3) result = c.sub() self.assertEqual(result, 5)