import unittest
import os
import filecmp
import shutil
import subprocess
EXEC_NAME = './inflate'
class TestInflate(unittest.TestCase):
def test_inflate(self):
subprocess.run([EXEC_NAME, 'tests/resources/compressed_expected.deflate'])
# Check that we extracted the correct file
self.assertTrue(os.path.exists('tests/resources/compressed_expected'))
# Check correct output (the DEFLATE stream should be decoded).
self.assertTrue(filecmp.cmp('tests/resources/compressed_expected',
'tests/resources/compressed_expected.txt'))
# Remove output
os.remove('tests/resources/compressed_expected')
if __name__ == '__main__':
unittest.main()
-
Mike Iovine authored3b264b70