Conditions | 1 |
Total Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | import unittest |
||
8 | def test_huffman_binary(self): |
||
9 | huffman = HuffmanCompressor() |
||
10 | text = 'Hello World' |
||
11 | bit_stream = huffman.compress_to_binary(text) |
||
12 | self.assertFalse(bit_stream.is_empty()) |
||
13 | print(bit_stream.size()) |
||
14 | decompressed = huffman.decompress_from_binary(bit_stream) |
||
15 | print(decompressed) |
||
16 | self.assertEqual(text, decompressed) |
||
17 | |||
25 |