Skip to content

Commit 8601472

Browse files
authored
Expand Tests (#6)
Expand tests into two files.
1 parent 6898e66 commit 8601472

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
language: python
22

3-
script: python calculator/calculator_test.py
3+
script:
4+
python calculator/test_calculator_simple.py;
5+
python calculator/test_calculator_advanced.py
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import calculator as c
2+
import unittest
3+
4+
class CalculatorTest(unittest.TestCase):
5+
def test_sum1(self):
6+
n = 10
7+
value1 = 0
8+
for i in range(1, n + 1):
9+
value1 = c.add(value1, i)
10+
self.assertEqual(value1, 55)
11+
value2 = c.divide(c.multiply(n, c.add(n, 1)), 2)
12+
self.assertEquals(value2, 55)
13+
14+
if __name__ == "__main__":
15+
unittest.main()

0 commit comments

Comments
 (0)