def test_generate(self):
     target = "methinks it is like a weasel"
     lenS = len(target)
     print(lenS)
     alphabet = list("abcdefghijklmnopqrstuvwxyz")
     lenA = len(alphabet)
     for i in range(10):
         string = generate(lenS, lenA, alphabet)
         print(len(string))
         self.assertEqual(len(string), lenS, "Should be equal to 28")
예제 #2
0
 def testZeroLength(self):
     data1 = 0
     data2 = 0
     data3 = ''
     result = generate(data1, data2, data3)
     self.assertEqual(result, [])
예제 #3
0
 def testGreaterThanZeroLength(self):
     data1 = 4
     data2 = 4
     data3 = 'abcd'
     resultLen = len(generate(data1, data2, data3))
     self.assertEqual(resultLen, 4)
예제 #4
0
 def test_generate_BaseCase(self):
     self.assertEqual(
         len(generate(0, 0, list("abcdefghijklmnopqrstuvwxyz "))), 0)
예제 #5
0
 def test_generate_programCase(self):
     self.assertEqual(
         len(generate(28, 27, list("abcdefghijklmnopqrstuvwxyz "))), 28)
예제 #6
0
 def test_long(self):
     result = generate(100000)
     self.assertEqual(len(result), 100000)
예제 #7
0
 def test_random(self):
     result_1 = generate(15)
     result_2 = generate(15)
     self.assertNotEqual(result_1, result_2)
예제 #8
0
 def test_short(self):
     result = generate(0)
     self.assertEqual(len(result), 0)
     self.assertIs