Пример #1
0
 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!')
Пример #2
0
 def setUp(self):
     self.cal = Calculator(8, 4)
Пример #3
0
 def test_add(self):
     c = Calculator(2, 4)
     result = c.add()
     self.assertEqual(result, 6)
Пример #4
0
 def test_div(self):
     c = Calculator(8, 3)
     result = c.div()
     self.assertNotEqual(result, 999)
Пример #5
0
 def test_mul(self):
     c = Calculator(2, 4)
     result = c.mul()
     self.assertEqual(result, 8)
Пример #6
0
 def test_sub(self):
     c = Calculator(8, 3)
     result = c.sub()
     self.assertEqual(result, 5)