def test_sub(self): d = Calculalor(7, 3) dd = d.sub() if dd > 1: result = True else: result = False self.assertTrue(result)
def test_div(self): g=Calculalor(8,4) result =g.div() self.assertEqual(result,2)
def test_mul(self): e=Calculalor(4,4) result = e.rid() self.assertEqual(result,16)
def test_sub(self): d=Calculalor(4,3) result=d.sub() self.assertEqual(result,4)
def test_add(self): c=Calculalor(5,3) result=c.add() self.assertEqual(result,8)
def test_div(self): f = Calculalor(10, 4) result = f.div() self.assertEqual(result, 2.5)
def test_rid(self): e = Calculalor(10, 2) result = e.rid() self.assertEqual(result, 20)
def test_add(): cd = Calculalor(3, 5) result = cd.add() assert result == 8, '加法运算失败!'
def test_div(): fd = Calculalor(9, 2) result = fd.div() assert result == 4, '触发运算失败'
def test_rid(): ed = Calculalor(8, 9) result = ed.rid() assert result == 72, '乘法运算失败!'
def test_sub(): dd = Calculalor(7, 2) result = dd.sub() assert result == 5, '减法运算失败!'