33import rotational_cipher
44
55
6+ # test cases adapted from `x-common//canonical-data.json` @ version: 1.0.0
7+
68class RotationalCipher (unittest .TestCase ):
79 def test_rotate_a_by_1 (self ):
810 self .assertEqual (rotational_cipher .rotate ('a' , 1 ), 'b' )
@@ -23,29 +25,22 @@ def test_rotate_capital_letters(self):
2325 self .assertEqual (rotational_cipher .rotate ('OMG' , 5 ), 'TRL' )
2426
2527 def test_rotate_spaces (self ):
26- self .assertEqual (rotational_cipher .rotate ('O M G' , 5 ),
27- 'T R L' )
28+ self .assertEqual (rotational_cipher .rotate ('O M G' , 5 ), 'T R L' )
2829
2930 def test_rotate_numbers (self ):
3031 self .assertEqual (
31- rotational_cipher .rotate (
32- 'Testing 1 2 3 testing' ,
33- 4 ),
32+ rotational_cipher .rotate ('Testing 1 2 3 testing' , 4 ),
3433 'Xiwxmrk 1 2 3 xiwxmrk' )
3534
3635 def test_rotate_punctuation (self ):
3736 self .assertEqual (
38- rotational_cipher .rotate (
39- "Let's eat, Grandma!" ,
40- 21 ),
37+ rotational_cipher .rotate ("Let's eat, Grandma!" , 21 ),
4138 "Gzo'n zvo, Bmviyhv!" )
4239
4340 def test_rotate_all_letters (self ):
4441 self .assertEqual (
45- rotational_cipher .rotate (
46- "The quick brown fox jumps"
47- " over the lazy dog." ,
48- 13 ),
42+ rotational_cipher .rotate ("The quick brown fox jumps"
43+ " over the lazy dog." , 13 ),
4944 "Gur dhvpx oebja sbk whzcf bire gur ynml qbt." )
5045
5146
0 commit comments