-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.py
23 lines (18 loc) · 810 Bytes
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
'''Tests for translation modules'''
import unittest
from translator import englishtofrench, englishtogerman
class TestEnglishtofrench(unittest.TestCase):
'''Tests English to French function'''
def test1(self):
'''Tests null, hello and snake translations'''
self.assertEqual(englishtofrench(None), '')
self.assertEqual(englishtofrench('Hello'), 'Bonjour')
self.assertEqual(englishtofrench('snake'), 'serpent')
class TestEnglishtogerman(unittest.TestCase):
'''Tests English to German function'''
def test1(self):
'''Tests null, hello and snake translations'''
self.assertEqual(englishtogerman(None), '')
self.assertEqual(englishtogerman('Hello'), 'Hallo')
self.assertEqual(englishtogerman('snake'), 'schlange')
unittest.main()