test_compression.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 import sys
3 import rospy
4 import rostest
5 import unittest
6 
7 from rosbridge_library.internal import pngcompression
8 
9 
10 class TestCompression(unittest.TestCase):
11 
12  def setUp(self):
13  rospy.init_node("test_compression")
14 
15  def test_compress(self):
16  bytes = list(range(128)) * 10000
17  string = str(bytearray(bytes))
18  encoded = pngcompression.encode(string)
19  self.assertNotEqual(string, encoded)
20 
22  bytes = list(range(128)) * 10000
23  string = str(bytearray(bytes))
24  encoded = pngcompression.encode(string)
25  self.assertNotEqual(string, encoded)
26  decoded = pngcompression.decode(encoded)
27  self.assertEqual(string, decoded)
28 
29 PKG = 'rosbridge_library'
30 NAME = 'test_compression'
31 if __name__ == '__main__':
32  rostest.unitrun(PKG, NAME, TestCompression)
33 


rosbridge_library
Author(s): Jonathan Mace
autogenerated on Fri May 10 2019 02:17:02