forked from PlatziMaster/challenge-python-05
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.py
More file actions
26 lines (18 loc) · 624 Bytes
/
tests.py
File metadata and controls
26 lines (18 loc) · 624 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
# This code was worked in class. It may be helpful to you to do the challenge.
def reverse_string(string):
return string[::-1]
if __name__ == '__main__':
import unittest
class StringsTests(unittest.TestCase):
def setUp(self):
self.strings = {
'hola': 'aloh',
'adios': 'soida',
'roma': 'amor'
}
def test_reverse_string(self):
for key, value in self.strings.items():
self.assertEqual(key, reverse_string(value))
def tearDown(self):
del(self.strings)
unittest.main()