File: test_large_file.py

package info (click to toggle)
python-apt 3.1.0
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,064 kB
  • sloc: cpp: 10,312; python: 8,812; makefile: 94; sh: 17
file content (25 lines) | stat: -rw-r--r-- 589 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
25
#!/usr/bin/python3

import sys
import unittest

import apt_inst
import testcommon

IS_NOT_32BIT = sys.maxsize > 2**32


@unittest.skipIf(IS_NOT_32BIT, "Large File support is for 32 bit systems")
class testHashes(testcommon.TestCase):
    "test the hashsum functions against strings and files"

    LARGE_PACKAGE_CONTENT = "data/test_debs/large-package-content_1.0_all.deb"

    def testExtractData(self):
        deb = apt_inst.DebFile(self.LARGE_PACKAGE_CONTENT)

        self.assertRaises(MemoryError, deb.data.extractdata, "large-file")


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