def test_encrypt_wrap_long(): """ Test basic encrypt text function, wrapping around 1 or more times """ assert Ceasar.encrypt("jklmnop", 30) == "nopqrst" assert Ceasar.encrypt("zanj", 94) == "pqdz" assert Ceasar.encrypt("ZANJ", 94) == "PQDZ"
def test_encrypt(): """ Test basic encrypt text function, with lower and upper case characters """ assert Ceasar.encrypt("abcdefghijklmn", 1) == "bcdefghijklmno" assert Ceasar.encrypt("jklmnop", 5) == "opqrstu" assert Ceasar.encrypt("xyza", 2) == "zabc" assert Ceasar.encrypt("XYZA", 2) == "ZABC"
def test_encrypt_caps_alternate(): """ Test basic encrypt text function, with upper and lower case characters in the same text """ assert Ceasar.encrypt("AbCdEf", 5) == "FgHiJk"
def test_encrypt_non_character(): """ Assert there is an error when trying to encrypt a text with a non character """ with pytest.raises(NotAllowedValue): assert Ceasar.encrypt("abcdefh0", 10)
def test_encrypt_no_offset(): """ Test basic encrypt text function, omitting `offset` parameter """ assert Ceasar.encrypt("abdef") == "abdef"