示例#1
0
文件: test_ch1.py 项目: rmartind/ctci
 def test_correct_three(self):
     string = 'aabcccccaaab'
     self.assertEqual('a2b1c5a3b1', strcompression.compress(string))
示例#2
0
文件: test_ch1.py 项目: rmartind/ctci
 def test_base(self):
     string = 'x'
     self.assertEqual('x1', strcompression.compress(string))
示例#3
0
文件: test_ch1.py 项目: rmartind/ctci
 def test_correct_two(self):
     string = 'aabbc'
     self.assertEqual('a2b2c1', strcompression.compress(string))
示例#4
0
文件: test_ch1.py 项目: rmartind/ctci
 def test_empty(self):
     string = ''
     self.assertRaises(ValueError, lambda: strcompression.compress(string))