コード例 #1
0
 def test_empty_sentence_zero_lines(self):
     result = ""
     output = pzz("", 0)
     self.assertEqual(result, output)
コード例 #2
0
 def test_half_zig_zag(self):
     result = "h    " + "\n" + " e   " + "\n" + "  l  " + "\n" + "   l " + "\n" + "    o"
     output = pzz("hello", 5)
     self.assertEqual(result, output)
コード例 #3
0
 def test_flat_sentence(self):
     result = "thisisazigzag"
     output = pzz("thisisazigzag", 1)
     self.assertEqual(result, output)
コード例 #4
0
 def test_book_example(self):
     result = "t     a     g" + "\n" + " h   s z   a " + "\n" + "  i i   i z  " + "\n" + "   s     g   "
     output = pzz("thisisazigzag", 4)
     self.assertEqual(result, output)
コード例 #5
0
 def test_sentence_with_zero_lines(self):
     result = ""
     output = pzz("thisisazigzag", 0)
     self.assertEqual(result, output)