Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions exercises/simple-cipher/simple_cipher_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from simple_cipher import Cipher


# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
# Tests adapted from `problem-specifications//canonical-data.json` @ v2.0.0

class SimpleCipherTest(unittest.TestCase):
# Utility functions
Expand Down Expand Up @@ -65,10 +65,14 @@ def test_can_wrap_on_decode(self):
cipher = Cipher('abcdefghij')
self.assertEqual(cipher.decode('zabcdefghi'), 'zzzzzzzzzz')

def test_can_handle_messages_longer_than_key(self):
def test_can_encode_messages_longer_than_key(self):
cipher = Cipher('abc')
self.assertEqual(cipher.encode('iamapandabear'), 'iboaqcnecbfcr')

def test_can_decode_messages_longer_than_key(self):
cipher = Cipher('abc')
self.assertEqual(cipher.decode('iboaqcnecbfcr'), 'iamapandabear')


if __name__ == '__main__':
unittest.main()