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)
def test_decode(self): cipher = VigenereCipher("TRAIN") decoded = cipher.decode("XECWQXUIVCRKHWA") self.assertTrue("ENCODEDINPYTHON" == decoded)
def test_decode(): cipher = VigenereCipher('TRAIN') decode = cipher.decode('XECWQXUIVCRKHWA') assert decode == 'ENCODEDINPYTHON'
def test_decode(): cipher = VigenereCipher("TRAIN") decoded = cipher.decode("XECWQXUIVCRKHWA") assert decoded == "ENCODEDINPYTHON"
def test_decode(): chip = VigenereCipher("TRAIN") encoded = chip.decode("XECWQXUIVCRKHWA") assert "ENCODEDINPYTHON" == encoded