예제 #1
0
from simple_math import add, substract

print(add(100, 50))
# output: 150
print(substract(100, 50))
# output: 50


# package code
from my_package import utils

utils.say_hello("LearnBATTA")
# output: LearnBATTA
예제 #2
0
 def test_add(self):
     expected = 5
     result = simple_math.add(2, 3)
     self.assertEquals(result, expected)
예제 #3
0
 def test_add(self):
     self.assertEqual(add(self.x, self.y), 2)
예제 #4
0
 def test_add(self):
     # test the add function
     self.assertEqual(add(1,0), 1)
     self.assertEqual(add(3,4), 7)
     self.assertEqual(add(-1,1), 0)
     self.assertEqual(add(-3, 5), 2)
예제 #5
0
 def test_one_and_one_fail(self):
     self.assertEqual(simple_math.add(1, 1), 4)
예제 #6
0
 def test_one_and_one_fail_assert(self):
     assert simple_math.add(1,1) == 4
예제 #7
0
 def test_add(self):
     self.assertEqual(add(self.x, self.y), 2)
예제 #8
0
 def test_one_and_one_fail(self):
     self.assertEqual(simple_math.add(1, 1), 4)
예제 #9
0
 def test_one_and_one_fail_assert(self):
     assert simple_math.add(1, 1) == 4