示例#1
0
def result_page():
    """Returns result page with encoded or decoded
    message"""
    keyword = request.form['keyword']
    choice = request.form['choice']
    message = request.form['message']
    cipher = VigenereCipher(keyword)
    if choice == 'encode':
        result = cipher.encode(message)
    else:
        result = cipher.decode(message)
    if result is None:
        return render_template('exception.html')
    return render_template('result.html', result=result)
示例#2
0
 def test_encode_2(self):
     cipher = VigenereCipher("LeaRNinG")
     encoded = cipher.encode("LeaRNINGpyThON")
     assert encoded == "WIAIAQAMACTYBV"
示例#3
0
 def test_encode(self):
     cipher = VigenereCipher("TRAIN")
     encoded = cipher.encode("ENCODEDINPYTHON")
     self.assertEqual(encoded, "XECWQXUIVCRKHWA")
def test_encode():
    cipher = VigenereCipher('TRAIN')
    encoded = cipher.encode('ENCODEDINPYTHON')
    assert encoded == 'XECWQXUIVCRKHWA'
def test_encode_character():
    cipher = VigenereCipher('TRAIN')
    encoded = cipher.encode('E')
    assert encoded == 'X'
示例#6
0
 def test_encode_lowercase(self):
     cipher = VigenereCipher("TRain")
     encoded = cipher.encode("encoded in Python")
     self.assertTrue(encoded == "XECWQXUIVCRKHWA")
def test_encode_lowercase():
	cipher = VigenereCipher("TRain")
	encoded = cipher.encode("encoded in Python")
	assert encoded == "XECWQXUIVCRKHWA"
示例#8
0
def test_encode_lowercase(valid_cipher):
    cipher = VigenereCipher("TRain")
    assert cipher.encode("encoded in Python") == "XECWQXUIVCRKHWA"
示例#9
0
 def test_encode_character():
     cipher = VigenereCipher("TRAIN")
     encoded = cipher.encode("E")
     assert encoded == "X"
def test_encode_lowercase():
    chip = VigenereCipher("TRAIN")
    encoded = chip.encode("encoded in python")
    assert "XECWQXUIVCRKHWA" == encoded
def test_encode():
    chip = VigenereCipher("TRAIN")
    encoded = chip.encode("ENCODED IN PYTHON")
    assert "XECWQXUIVCRKHWA" == encoded
def test_encode_character():
    chip = VigenereCipher("TRAIN")
    encoded = chip.encode("E")
    assert "X" == encoded
def test_encode_charecter():
	cipher = VigenereCipher("TRAIN")
	encoded = cipher.encode("E")
	assert encoded == "X"
def test_encode():
	cipher = VigenereCipher("TRAIN")
	encoded = cipher.encode("ENCODEDINPYTHON")
	assert encoded == "XECWQXUIVCRKHWA"
示例#15
0
 def test_encode_character(self):
     cipher = VigenereCipher("TRAIN")
     encoded = cipher.encode("E")
     self.assertTrue(encoded == "X")
示例#16
0
 def test_encode_lowercase():
     cipher = VigenereCipher("TRain")
     encoded = cipher.encode("encoded in Python")
     assert encoded == "XECWQXUIVCRKHWA"
示例#17
0
 def test_encode_spaces(self):
     cipher = VigenereCipher("TRAIN")
     encoded = cipher.encode("ENCODED IN PYTHON")
     self.assertTrue(encoded == "XECWQXUIVCRKHWA")
def test_encode_lowercase():
    cipher = VigenereCipher('TRain')
    encoded = cipher.encode('encoded in Python')
    assert encoded == 'XECWQXUIVCRKHWA'
示例#19
0
 def test_encode_1(self):
     cipher = VigenereCipher("TRAIN")
     encoded = cipher.encode("ENCODEDINPYTHON")
     assert encoded == "XECWQXUIVCRKHWA"
def test_encode_lowercase(valid_cipher):
    cipher = VigenereCipher("TRain")
    assert cipher.encode("encoded in Python") == "XECWQXUIVCRKHWA"