File: test.py

package info (click to toggle)
lz4tools 1.3.1.1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 380 kB
  • sloc: ansic: 3,988; python: 377; makefile: 8
file content (24 lines) | stat: -rw-r--r-- 615 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import lz4tools
import os
import unittest


class TestLZ4File(unittest.TestCase):

    def test_1_write(self):
        lz4tools.compressTarDefault('src')
        self.assertTrue(os.path.exists('src.tar.lz4'))

    def test_2_file(self):
        testTar = lz4tools.openTar('src.tar.lz4')
        count = testTar.getmembers()
        testTar.close()
        dircount = 1
        for root, dirs, files in os.walk('src'):
            dircount += len(dirs)
            dircount += len(files)
        self.assertEqual(dircount, len(count))
        os.remove('src.tar.lz4')

if __name__ == '__main__':
    unittest.main()