Exemplo n.º 1
0
def test_code_msg_ceasar_chiper():
    key = 'bcdefghijklmnopqrstuvwxyza'
    coder = Coder(key)
    ciphertext = 'cbobob'
    plaintext = 'banana'
    assert coder.crypt(plaintext) == ciphertext
Exemplo n.º 2
0
def test_code_msg_one_letter_different():
    key = 'abcdefghijklmnopq$stuvwxyz'
    coder = Coder(key)
    plaintext = 'door'
    ciphertext = 'doo$'
    assert coder.crypt(plaintext) == ciphertext
Exemplo n.º 3
0
def test_code_msg_random_key():
    key = '!)"(£*%&><@abcdefghijklmno'
    coder = Coder(key)
    plaintext = 'calendario'
    ciphertext = '"!a£c(!g>d'
    assert coder.crypt(plaintext) == ciphertext
Exemplo n.º 4
0
def test_code_msg_no_changes():
    key = 'abcdefghijklmnopqrstuvwxyz'
    coder = Coder(key)
    ciphertext = 'banana'
    plaintext = 'banana'
    assert coder.crypt(plaintext) == ciphertext