2015-07-04 07:55:56 +08:00
|
|
|
from nose.tools import assert_equal
|
|
|
|
|
|
|
|
|
|
|
|
class TestCompress(object):
|
2015-07-12 03:34:14 +08:00
|
|
|
|
2015-07-04 07:55:56 +08:00
|
|
|
def test_compress(self, func):
|
|
|
|
assert_equal(func(None), None)
|
|
|
|
assert_equal(func(''), '')
|
|
|
|
assert_equal(func('AABBCC'), 'AABBCC')
|
2016-02-10 19:29:22 +08:00
|
|
|
assert_equal(func('AAABCCDDDDE'), 'A3BC2D4E')
|
2015-07-04 07:55:56 +08:00
|
|
|
print('Success: test_compress')
|
|
|
|
|
2015-07-12 03:34:14 +08:00
|
|
|
|
2015-07-04 07:55:56 +08:00
|
|
|
def main():
|
|
|
|
test = TestCompress()
|
2016-08-13 18:37:48 +08:00
|
|
|
compress_string = CompressString()
|
|
|
|
test.test_compress(compress_string.compress)
|
2015-07-04 07:55:56 +08:00
|
|
|
|
2015-07-12 03:34:14 +08:00
|
|
|
|
2015-07-04 07:55:56 +08:00
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|