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