17 lines
565 B
Python
17 lines
565 B
Python
from unittest import TestCase
|
|
from benchmark.caesar_cipher import encrypt
|
|
from benchmark.caesar_cipher import decrypt
|
|
|
|
|
|
class Test_encrypt(TestCase):
|
|
# distances_true = {1: [0, 6, 0, 10, 0, 0, 0, 0]}
|
|
# distances_false = {1: [48, 0, 60, 0, 57, 30, 25, 47]}
|
|
def test_encrypt_1(self):
|
|
assert encrypt(strng='_*k&hMH^', key=79) == 'Oy[uX=8N'
|
|
|
|
|
|
class Test_decrypt(TestCase):
|
|
# distances_true = {2: [0, 0, 32, 0]}
|
|
# distances_false = {2: [1, 12, 0, 24]}
|
|
def test_decrypt_1(self):
|
|
assert decrypt(strng='\\Q|E', key=61) == '~s?g'
|