コード例 #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']