Ejemplo n.º 1
0
def test_decrypt_message():
    s = SimpleSubstitution(**params)
    cryptogram = s.decrypt("khoorczruog")
    assert cryptogram == "hello world"
Ejemplo n.º 2
0
def test_encrypt_shift():
    s = SimpleSubstitution(**params)
    assert s.encrypt_shift("a") == "d"
Ejemplo n.º 3
0
def test_decrypt_shift():
    s = SimpleSubstitution(**params)
    assert s.decrypt_shift("d") == "a"
Ejemplo n.º 4
0
def test_params():
    s = SimpleSubstitution(k27, 28)
    assert s.key == 1
Ejemplo n.º 5
0
def test_decrypt_message():
    s = SimpleSubstitution(**params)
    cryptogram = s.decrypt('khoorczruog')
    assert cryptogram == 'hello world'
Ejemplo n.º 6
0
def test_decrypt_shift():
    s = SimpleSubstitution(**params)
    assert s.decrypt_shift('d') == 'a'
Ejemplo n.º 7
0
def test_encrypt_shift():
    s = SimpleSubstitution(**params)
    assert s.encrypt_shift('a') == 'd'
Ejemplo n.º 8
0
def test_key_bigger_than_alphabet():
    s = SimpleSubstitution(**params)
    assert s.alphabet == params['alphabet']
    assert s.key == params['key']