Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
test.test_tarfile.MemberReadTest Class Reference
Inheritance diagram for test.test_tarfile.MemberReadTest:
Inheritance graph
[legend]
Collaboration diagram for test.test_tarfile.MemberReadTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_find_regtype
def test_find_conttype
def test_find_dirtype
def test_find_dirtype_with_size
def test_find_lnktype
def test_find_symtype
def test_find_blktype
def test_find_chrtype
def test_find_fifotype
def test_find_sparse
def test_find_gnusparse
def test_find_gnusparse_00
def test_find_gnusparse_01
def test_find_gnusparse_10
def test_find_umlauts
def test_find_ustar_longname
def test_find_regtype_oldv7
def test_find_pax_umlauts
def setUp
def tearDown

Public Attributes

 tar

Static Public Attributes

 tarname = tarname
string mode = "r:"

Private Member Functions

def _test_member

Detailed Description

Definition at line 533 of file test_tarfile.py.


Member Function Documentation

def test.test_tarfile.MemberReadTest._test_member (   self,
  tarinfo,
  chksum = None,
  kwargs 
) [private]

Definition at line 535 of file test_tarfile.py.

00535 
00536     def _test_member(self, tarinfo, chksum=None, **kwargs):
00537         if chksum is not None:
00538             self.assertTrue(md5sum(self.tar.extractfile(tarinfo).read()) == chksum,
00539                     "wrong md5sum for %s" % tarinfo.name)
00540 
00541         kwargs["mtime"] = 0o7606136617
00542         kwargs["uid"] = 1000
00543         kwargs["gid"] = 100
00544         if "old-v7" not in tarinfo.name:
00545             # V7 tar can't handle alphabetic owners.
00546             kwargs["uname"] = "tarfile"
00547             kwargs["gname"] = "tarfile"
00548         for k, v in kwargs.items():
00549             self.assertTrue(getattr(tarinfo, k) == v,
00550                     "wrong value in %s field of %s" % (k, tarinfo.name))

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_tarfile.ReadTest.setUp (   self) [inherited]

Definition at line 43 of file test_tarfile.py.

00043 
00044     def setUp(self):
00045         self.tar = tarfile.open(self.tarname, mode=self.mode, encoding="iso8859-1")

Here is the caller graph for this function:

def test.test_tarfile.ReadTest.tearDown (   self) [inherited]

Definition at line 46 of file test_tarfile.py.

00046 
00047     def tearDown(self):
00048         self.tar.close()
00049 

Here is the caller graph for this function:

Definition at line 575 of file test_tarfile.py.

00575 
00576     def test_find_blktype(self):
00577         tarinfo = self.tar.getmember("ustar/blktype")
00578         self._test_member(tarinfo, size=0, devmajor=3, devminor=0)

Here is the call graph for this function:

Definition at line 579 of file test_tarfile.py.

00579 
00580     def test_find_chrtype(self):
00581         tarinfo = self.tar.getmember("ustar/chrtype")
00582         self._test_member(tarinfo, size=0, devmajor=1, devminor=3)

Here is the call graph for this function:

Definition at line 555 of file test_tarfile.py.

00555 
00556     def test_find_conttype(self):
00557         tarinfo = self.tar.getmember("ustar/conttype")
00558         self._test_member(tarinfo, size=7011, chksum=md5_regtype)

Here is the call graph for this function:

Definition at line 559 of file test_tarfile.py.

00559 
00560     def test_find_dirtype(self):
00561         tarinfo = self.tar.getmember("ustar/dirtype")
00562         self._test_member(tarinfo, size=0)

Here is the call graph for this function:

Definition at line 563 of file test_tarfile.py.

00563 
00564     def test_find_dirtype_with_size(self):
00565         tarinfo = self.tar.getmember("ustar/dirtype-with-size")
00566         self._test_member(tarinfo, size=255)

Here is the call graph for this function:

Definition at line 583 of file test_tarfile.py.

00583 
00584     def test_find_fifotype(self):
00585         tarinfo = self.tar.getmember("ustar/fifotype")
00586         self._test_member(tarinfo, size=0)

Here is the call graph for this function:

Definition at line 591 of file test_tarfile.py.

00591 
00592     def test_find_gnusparse(self):
00593         tarinfo = self.tar.getmember("gnu/sparse")
00594         self._test_member(tarinfo, size=86016, chksum=md5_sparse)

Here is the call graph for this function:

Definition at line 595 of file test_tarfile.py.

00595 
00596     def test_find_gnusparse_00(self):
00597         tarinfo = self.tar.getmember("gnu/sparse-0.0")
00598         self._test_member(tarinfo, size=86016, chksum=md5_sparse)

Here is the call graph for this function:

Definition at line 599 of file test_tarfile.py.

00599 
00600     def test_find_gnusparse_01(self):
00601         tarinfo = self.tar.getmember("gnu/sparse-0.1")
00602         self._test_member(tarinfo, size=86016, chksum=md5_sparse)

Here is the call graph for this function:

Definition at line 603 of file test_tarfile.py.

00603 
00604     def test_find_gnusparse_10(self):
00605         tarinfo = self.tar.getmember("gnu/sparse-1.0")
00606         self._test_member(tarinfo, size=86016, chksum=md5_sparse)

Here is the call graph for this function:

Definition at line 567 of file test_tarfile.py.

00567 
00568     def test_find_lnktype(self):
00569         tarinfo = self.tar.getmember("ustar/lnktype")
00570         self._test_member(tarinfo, size=0, linkname="ustar/regtype")

Here is the call graph for this function:

Definition at line 619 of file test_tarfile.py.

00619 
00620     def test_find_pax_umlauts(self):
00621         self.tar.close()
00622         self.tar = tarfile.open(self.tarname, mode=self.mode, encoding="iso8859-1")
00623         tarinfo = self.tar.getmember("pax/umlauts-\xc4\xd6\xdc\xe4\xf6\xfc\xdf")
00624         self._test_member(tarinfo, size=7011, chksum=md5_regtype)
00625 

Definition at line 551 of file test_tarfile.py.

00551 
00552     def test_find_regtype(self):
00553         tarinfo = self.tar.getmember("ustar/regtype")
00554         self._test_member(tarinfo, size=7011, chksum=md5_regtype)

Here is the call graph for this function:

Definition at line 615 of file test_tarfile.py.

00615 
00616     def test_find_regtype_oldv7(self):
00617         tarinfo = self.tar.getmember("misc/regtype-old-v7")
00618         self._test_member(tarinfo, size=7011, chksum=md5_regtype)

Here is the call graph for this function:

Definition at line 587 of file test_tarfile.py.

00587 
00588     def test_find_sparse(self):
00589         tarinfo = self.tar.getmember("ustar/sparse")
00590         self._test_member(tarinfo, size=86016, chksum=md5_sparse)

Here is the call graph for this function:

Definition at line 571 of file test_tarfile.py.

00571 
00572     def test_find_symtype(self):
00573         tarinfo = self.tar.getmember("ustar/symtype")
00574         self._test_member(tarinfo, size=0, linkname="regtype")

Here is the call graph for this function:

Definition at line 607 of file test_tarfile.py.

00607 
00608     def test_find_umlauts(self):
00609         tarinfo = self.tar.getmember("ustar/umlauts-\xc4\xd6\xdc\xe4\xf6\xfc\xdf")
00610         self._test_member(tarinfo, size=7011, chksum=md5_regtype)

Here is the call graph for this function:

Definition at line 611 of file test_tarfile.py.

00611 
00612     def test_find_ustar_longname(self):
00613         name = "ustar/" + "12345/" * 39 + "1234567/longname"
00614         self.assertIn(name, self.tar.getnames())

Here is the call graph for this function:


Member Data Documentation

string test.test_tarfile.ReadTest.mode = "r:" [static, inherited]

Reimplemented from test.test_tarfile.ReadTest.

Definition at line 621 of file test_tarfile.py.


The documentation for this class was generated from the following file: