test_ceasar_cipher.Tests.test_Extra()   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 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