<s> import sys <EOL> import rospy <EOL> import rostest <EOL> import unittest <EOL> from rosbridge_library . internal import pngcompression <EOL> class TestCompression ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> rospy . init_node ( "<STR_LIT>" ) <EOL> def test_compress ( self ) : <EOL> bytes = range ( <NUM_LIT> ) * <NUM_LIT> <EOL> string = str ( bytearray ( bytes ) ) <EOL> encoded = pngcompression . encode ( string ) <EOL> self . assertNotEqual ( string , encoded ) <EOL> def test_compress_decompress ( self ) : <EOL> bytes = range ( <NUM_LIT> ) * <NUM_LIT> <EOL> string = str ( bytearray ( bytes ) ) <EOL> encoded = pngcompression . encode ( string ) <EOL> self . assertNotEqual ( string , encoded ) <EOL> decoded = pngcompression . decode ( encoded ) <EOL> self . assertEqual ( string , decoded ) <EOL> PKG = '<STR_LIT>' <EOL> NAME = '<STR_LIT>' <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> rostest . unitrun ( PKG , NAME , TestCompression ) </s>
