Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_tarfile.HardlinkTest Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_add_twice
def test_add_hardlink
def test_dereference_hardlink

Public Attributes

 foo
 bar
 tar

Detailed Description

Definition at line 1189 of file test_tarfile.py.


Member Function Documentation

Definition at line 1192 of file test_tarfile.py.

01192 
01193     def setUp(self):
01194         self.foo = os.path.join(TEMPDIR, "foo")
01195         self.bar = os.path.join(TEMPDIR, "bar")
01196 
01197         with open(self.foo, "wb") as fobj:
01198             fobj.write(b"foo")
01199 
01200         os.link(self.foo, self.bar)
01201 
01202         self.tar = tarfile.open(tmpname, "w")
01203         self.tar.add(self.foo)

Here is the caller graph for this function:

Definition at line 1204 of file test_tarfile.py.

01204 
01205     def tearDown(self):
01206         self.tar.close()
01207         support.unlink(self.foo)
01208         support.unlink(self.bar)

Here is the caller graph for this function:

Definition at line 1216 of file test_tarfile.py.

01216 
01217     def test_add_hardlink(self):
01218         tarinfo = self.tar.gettarinfo(self.bar)
01219         self.assertTrue(tarinfo.type == tarfile.LNKTYPE,
01220                 "add file as hardlink failed")

Here is the call graph for this function:

Definition at line 1209 of file test_tarfile.py.

01209 
01210     def test_add_twice(self):
01211         # The same name will be added as a REGTYPE every
01212         # time regardless of st_nlink.
01213         tarinfo = self.tar.gettarinfo(self.foo)
01214         self.assertTrue(tarinfo.type == tarfile.REGTYPE,
01215                 "add file as regular failed")

Here is the call graph for this function:

Definition at line 1221 of file test_tarfile.py.

01221 
01222     def test_dereference_hardlink(self):
01223         self.tar.dereference = True
01224         tarinfo = self.tar.gettarinfo(self.bar)
01225         self.assertTrue(tarinfo.type == tarfile.REGTYPE,
01226                 "dereferencing hardlink failed")
01227 

Here is the call graph for this function:


Member Data Documentation

Definition at line 1194 of file test_tarfile.py.

Definition at line 1193 of file test_tarfile.py.

Definition at line 1201 of file test_tarfile.py.


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