File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
src/rosbridge_library/internal Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ def encode(string):
49
49
buff = BytesIO ()
50
50
i .save (buff , "png" )
51
51
encoded = standard_b64encode (buff .getvalue ())
52
- return encoded
52
+ return encoded . decode ()
53
53
54
54
55
55
def decode (string ):
Original file line number Diff line number Diff line change @@ -10,10 +10,11 @@ def test_compress(self):
10
10
string = str (bytearray (bytes_data ))
11
11
encoded = pngcompression .encode (string )
12
12
self .assertNotEqual (string , encoded )
13
+ self .assertIsInstance (encoded , str )
13
14
14
15
def test_compress_decompress (self ):
15
16
bytes_data = list (range (128 )) * 10000
16
- string = str (bytes (bytes_data ))
17
+ string = str (bytearray (bytes_data ))
17
18
encoded = pngcompression .encode (string )
18
19
self .assertNotEqual (string , encoded )
19
20
decoded = pngcompression .decode (encoded )
You can’t perform that action at this time.
0 commit comments