forked from dunossauro/live-de-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.py
More file actions
32 lines (19 loc) · 675 Bytes
/
tests.py
File metadata and controls
32 lines (19 loc) · 675 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from unittest import TestCase, main
from calculator import soma, invert, sum_, is_number, check_numbers
class SomaTests(TestCase):
def test_soma(self):
self.assertEqual(soma(10, 10), 20)
class InvertTests(TestCase):
def test_invert(self):
self.assertEqual(invert(5), -5)
class SumTests(TestCase):
def test_sum(self):
self.assertEqual(sum_(1, 2, 3, 4), 10)
class Is_numberTests(TestCase):
def test_is_number(self):
self.assertEqual(is_number(1), True)
class Check_numbersTests(TestCase):
def test_check_numbers(self):
self.assertEqual(check_numbers(1, 'a'), False)
if __name__ == '__main__':
main()