Esempio n. 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)
Esempio n. 2
0
 def test_encode_2(self):
     cipher = VigenereCipher("LeaRNinG")
     encoded = cipher.encode("LeaRNINGpyThON")
     assert encoded == "WIAIAQAMACTYBV"
Esempio n. 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'
Esempio n. 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"
Esempio n. 8
0
def test_encode_lowercase(valid_cipher):
    cipher = VigenereCipher("TRain")
    assert cipher.encode("encoded in Python") == "XECWQXUIVCRKHWA"
Esempio n. 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"
Esempio n. 15
0
 def test_encode_character(self):
     cipher = VigenereCipher("TRAIN")
     encoded = cipher.encode("E")
     self.assertTrue(encoded == "X")
Esempio n. 16
0
 def test_encode_lowercase():
     cipher = VigenereCipher("TRain")
     encoded = cipher.encode("encoded in Python")
     assert encoded == "XECWQXUIVCRKHWA"
Esempio n. 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'
Esempio n. 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"