예제 #1
0
 def test_invalid_text(self):
     """args must be (str, int), not (int, int)"""
     assert encrypt(1, 1) == self.arg_error_msg
예제 #2
0
 def test_numbers(self):
     """numbers should not change, since they are not in [a-zA-Z]"""
     assert encrypt("1234", 1) == "1234"
예제 #3
0
 def test_invalid_offset(self):
     """args must be (str, int), not (str, str)"""
     assert encrypt("asdf", "asdf") == self.arg_error_msg
예제 #4
0
 def test_no_change(self):
     """Using 0 as the offset value should not change the result at all"""
     assert encrypt("asdf", 0) == "asdf"
예제 #5
0
 def test_negative_circular_offset(self):
     """uses circular list, so -1 is the same as 25 (26 - 1)"""
     assert encrypt("AsDf", -1) == encrypt("AsDf", 25)
예제 #6
0
 def test_circular_offset(self):
     """uses circular list, so 1 is the same as 27 (26 + 1)"""
     assert encrypt("AsDf", 1) == encrypt("AsDf", 27)
예제 #7
0
 def test_decrypt(self):
     """Using a negative value for the offset should undo the encryption"""
     assert encrypt("Ifmmp Xpsme!", -1) == "Hello World!"
예제 #8
0
 def test_encrypt_case_sensitive(self):
     assert encrypt("Hello World!", 1) == "Ifmmp Xpsme!"