def test_uppercase_decipher(self): cipher_suite = VigenereCipher("LEMON") eq_(cipher_suite.decipher("LXFOPV"), "ATTACK")
def test_lowercase_decipher(self): cipher_suite = VigenereCipher("lemon") eq_(cipher_suite.decipher("lxfopv"), "ATTACK")
def test_lowercase_encipher(self): cipher_suite = VigenereCipher("lemon") eq_(cipher_suite.encipher("attack"), "LXFOPV")
def test_empty_key(self): with assert_raises(ValueError): VigenereCipher("") with assert_raises(ValueError): VigenereCipher("123!")
def test_decipher_non_alphabetic_characters(self): cipher_suite = VigenereCipher(PANGRAM) eq_( cipher_suite.decipher("KEOQAU TG BNKSE HNZANC, VSYUA BF ILK!"), PANGRAM.upper(), )
def test_encipher_non_alphabetic_characters(self): cipher_suite = VigenereCipher(PANGRAM) eq_(cipher_suite.encipher(PANGRAM), "KEOQAU TG BNKSE HNZANC, VSYUA BF ILK!")
def pytest_funcarg__cipher(request): return VigenereCipher("TRAIN")