コード例 #1
0
ファイル: test_module.py プロジェクト: tri2sing/PyOO
def test_decode():
    cipher = VigenereCipher("TRAIN")
    decoded = cipher.decode("XECWQXUIVCRKHWA")
    assert decoded == "ENCODEDINPYTHON"
コード例 #2
0
ファイル: test_module.py プロジェクト: tri2sing/PyOO
def test_extend_keyword():
    cipher = VigenereCipher('TRAIN')
    extended = cipher.extend_keyword(16)
    assert extended == 'TRAINTRAINTRAINT'
コード例 #3
0
ファイル: test_module.py プロジェクト: tri2sing/PyOO
def test_encode_lowercase():
    '''Expected behavior of the encode is to convert the input to all upper case'''
    cipher = VigenereCipher("TRain")
    encoded = cipher.encode("encoded in Python")
    assert encoded == "XECWQXUIVCRKHWA"
コード例 #4
0
ファイル: test_module.py プロジェクト: tri2sing/PyOO
def test_encode_spaces():
    '''Expected behavior of encoder is to remove the spaces in the input'''
    cipher = VigenereCipher("TRAIN")
    encoded = cipher.encode("ENCODED IN PYTHON")
    assert encoded == "XECWQXUIVCRKHWA"
コード例 #5
0
ファイル: test_module.py プロジェクト: tri2sing/PyOO
def test_econde_character():
    cipher = VigenereCipher('TRAIN')
    encoded = cipher.encode('E')
    assert encoded == 'X'
コード例 #6
0
ファイル: test_module.py プロジェクト: tri2sing/PyOO
def test_encode_string():
    cipher = VigenereCipher('TRAIN')
    encoded = cipher.encode('ENCODEDINPYTHON')
    assert encoded == 'XECWQXUIVCRKHWA'