2023-12-09 19:52:07 +00:00
|
|
|
from unittest import TestCase
|
|
|
|
from benchmark.caesar_cipher import encrypt
|
|
|
|
from benchmark.caesar_cipher import decrypt
|
|
|
|
|
|
|
|
|
|
|
|
class Test_encrypt(TestCase):
|
2023-12-20 13:19:45 +00:00
|
|
|
# distances_true = {1: [16, 0, 17, 0, 0, 41, 31]}
|
|
|
|
# distances_false = {1: [0, 42, 0, 13, 52, 0, 0]}
|
2023-12-09 19:52:07 +00:00
|
|
|
def test_encrypt_1(self):
|
2023-12-20 13:19:45 +00:00
|
|
|
assert encrypt(strng=';t:W~",', key=52) == 'oIn,SV`'
|
2023-12-09 19:52:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Test_decrypt(TestCase):
|
2023-12-20 13:19:45 +00:00
|
|
|
# distances_true = {2: [215, 0, 6, 0, 25, 0, 0, 223]}
|
|
|
|
# distances_false = {2: [0, 6, 0, 18, 0, 19, 27, 0]}
|
2023-12-09 19:52:07 +00:00
|
|
|
def test_decrypt_1(self):
|
2023-12-20 13:19:45 +00:00
|
|
|
assert decrypt(strng="'KV?i>6/", key=49) == 'öy%m8ldþ'
|