| Total Complexity | 4 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import unittest |
||
| 2 | |||
| 3 | from ceasar_cipher import to_encrypt |
||
| 4 | |||
| 5 | |||
| 6 | class Tests(unittest.TestCase): |
||
| 7 | TESTS = { |
||
| 8 | "Basics": [ |
||
| 9 | {"input": ("a b c", 3), "answer": 'd e f'}, |
||
| 10 | {"input": ("a b c", -3), "answer": 'x y z'}, |
||
| 11 | ], |
||
| 12 | "Extra": [ |
||
| 13 | {"input": ("simple text", 16), "answer": "iycfbu junj"}, |
||
| 14 | {"input": ("important text", 10), "answer": "swzybdkxd dohd"}, |
||
| 15 | {"input": ("state secret", -13), "answer": "fgngr frperg"}, |
||
| 16 | ], |
||
| 17 | } |
||
| 18 | |||
| 19 | def test_Basics(self): |
||
| 20 | for i in self.TESTS['Basics']: |
||
| 21 | assert to_encrypt(i['input'][0], i['input'][1]) == i['answer'] |
||
| 22 | |||
| 23 | def test_Extra(self): |
||
| 24 | for i in self.TESTS['Extra']: |
||
| 25 | assert to_encrypt(i['input'][0], i['input'][1]) == i['answer'] |
||
| 26 | |||
| 27 | |||
| 28 | if __name__ == "__main__": # pragma: no cover |
||
| 29 | unittest.main() |
||
| 30 |