This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
kse-02/tests/test_caesar_cipher.py

28 lines
768 B
Python
Raw Normal View History

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-11 14:43:53 +00:00
# distances_true = {1: [1]}
# distances_false = {1: [0]}
2023-12-09 19:52:07 +00:00
def test_encrypt_1(self):
2023-12-11 14:43:53 +00:00
assert encrypt(strng='U', key=41) == '~'
2023-12-09 19:52:07 +00:00
2023-12-11 14:43:53 +00:00
# distances_true = {1: [0]}
# distances_false = {1: [1]}
2023-12-09 19:52:07 +00:00
def test_encrypt_2(self):
2023-12-11 14:43:53 +00:00
assert encrypt(strng='h', key=23) == ' '
2023-12-09 19:52:07 +00:00
class Test_decrypt(TestCase):
2023-12-11 14:43:53 +00:00
# distances_true = {2: [1]}
# distances_false = {2: [0]}
2023-12-09 19:52:07 +00:00
def test_decrypt_1(self):
2023-12-11 14:43:53 +00:00
assert decrypt(strng='C', key=35) == ' '
2023-12-09 19:52:07 +00:00
2023-12-11 14:43:53 +00:00
# distances_true = {2: [0]}
# distances_false = {2: [1]}
2023-12-09 19:52:07 +00:00
def test_decrypt_2(self):
2023-12-11 14:43:53 +00:00
assert decrypt(strng='7', key=24) == '~'