def test_decrypt_wrap_long(): """ Test basic decrypt text function, wrapping around 1 or more times """ assert Ceasar.decrypt("npqusn", 30) == "jlmqoj" assert Ceasar.decrypt("pasdads", 94) == "zkcnknc" assert Ceasar.decrypt("PASDADS", 94) == "ZKCNKNC"
def test_decrypt(): """ Test basic decrypt text function, with lower and upper case characters """ assert Ceasar.decrypt("bcdefghijklmno", 1) == "abcdefghijklmn" assert Ceasar.decrypt("opqrstu", 5) == "jklmnop" assert Ceasar.decrypt("zabc", 2) == "xyza" assert Ceasar.decrypt("ZABC", 2) == "XYZA"
def test_decrypt_caps_alternate(): """ Test basic decrypt text function, with upper and lower case characters in the same text """ assert Ceasar.decrypt("FgHiJk", 5) == "AbCdEf"
def test_decrypt_non_character(): """ Assert there is an error when trying to decrypt a text with a non character """ with pytest.raises(NotAllowedValue): assert Ceasar.decrypt("abcdefh0", 10)
def test_decrypt_no_offset(): """ Test basic decrypt text function, omitting `offset` parameter """ assert Ceasar.decrypt("abdef") == "abdef"