-
Notifications
You must be signed in to change notification settings - Fork 1
/
SimpleEncryption01_test.py
48 lines (34 loc) · 1.86 KB
/
SimpleEncryption01_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from unittest import TestCase
from SimpleEncryption01AlternatingSplit_6kyu import decrypt, encrypt
class TestDecrypt(TestCase):
def test_NullIsNull(self):
self.assertEquals(decrypt("", 0), "")
def test_NoneIsNone(self):
self.assertEquals(decrypt(None, 0), None)
def test_ThisZeroIsThis(self):
self.assertEquals(decrypt("This is a test!", 0), "This is a test!")
def test_HsiOneIsThis(self):
self.assertEquals(decrypt("hsi etTi sats!", 1), "This is a test!")
def test_S_eTTwoIsThis(self):
self.assertEquals(decrypt("s eT ashi tist!", 2), "This is a test!")
def test_VariousMoreThanOneIsThis(self):
self.assertEquals(encrypt("This is a test!", 3), " Tah itse sits!")
self.assertEquals(encrypt("This is a test!", 4), "This is a test!")
self.assertEquals(encrypt("This is a test!", -1), "This is a test!")
self.assertEquals(encrypt("This kata is very interesting!", 1), "hskt svr neetn!Ti aai eyitrsig")
class TestEncrypt(TestCase):
def test_NullIsNull(self):
self.assertEquals(encrypt("", 0), "")
def test_NoneIsNone(self):
self.assertEquals(encrypt(None, 0), None)
def test_ThisZeroIsThis(self):
self.assertEquals(encrypt("This is a test!", 0), "This is a test!")
def test_ThisOneIsHsi(self):
self.assertEquals(encrypt("This is a test!", 1), "hsi etTi sats!")
def test_ThisTwoIsS_eT(self):
self.assertEquals(encrypt("This is a test!", 2), "s eT ashi tist!")
def test_ThisMoreThanOneIsVarious(self):
self.assertEquals(encrypt("This is a test!", 3), " Tah itse sits!")
self.assertEquals(encrypt("This is a test!", 4), "This is a test!")
self.assertEquals(encrypt("This is a test!", -1), "This is a test!")
self.assertEquals(encrypt("This kata is very interesting!", 1), "hskt svr neetn!Ti aai eyitrsig")