l.a.t.t.TestRepositoryArchiveIndex(unittest.TestCase) : class documentation

Part of lp.archivepublisher.tests.test_repositoryindexfile View In Hierarchy

No class docstring
Method setUp Create temporary directories to be used in tests.
Method tearDown Purge temporary files created on setUp.
Method getRepoFile Return a RepositoryIndexFile for the given filename.
Method testWorkflow RepositoryIndexFile workflow.
Method testWrite RepositoryIndexFile writing.
Method testCompressors RepositoryIndexFile honours the supplied list of compressors.
Method testUnreferencing RepositoryIndexFile unreferencing.
Method testRootCreation RepositoryIndexFile creates given 'root' path if necessary.
Method testMissingTempRoot RepositoryIndexFile cannot be given a missing 'temp_root'.
Method testRemoveOld RepositoryIndexFile removes old index files.
def setUp(self):
Create temporary directories to be used in tests.

'root': final destination for repository files. 'temp_root': temporary destination for reporsitory files.

def tearDown(self):
Purge temporary files created on setUp.
def getRepoFile(self, filename, compressors=None):
Return a RepositoryIndexFile for the given filename.

The RepositoryIndexFile is created with the test 'root' and 'temp_root'.

def testWorkflow(self):
RepositoryIndexFile workflow.

On creation, 2 temporary files are atomically created in the 'temp_root' location (mkstemp). One for storing the plain contents and other for the corresponding compressed contents. At this point, no files were created in the 'root' location yet.

Once the RepositoryIndexFile is closed, the files in 'temp_root' are closed and moved to 'root' with their expected names.

Additionally, the resulting files are made readable and writable by their group and readable by others.

def testWrite(self):
RepositoryIndexFile writing.

Writes to a RepositoryIndexFile happens simultaneously in both of its counter-parts (plain and gzipped contents). Once the file is closed both resulting files have the same contents, one plain and other compressed.

def testCompressors(self):
RepositoryIndexFile honours the supplied list of compressors.
def testUnreferencing(self):
RepositoryIndexFile unreferencing.

When a RepositoryIndexFile is unreferenced it takes care of removing the created files in the 'temp_root'.

def testRootCreation(self):
RepositoryIndexFile creates given 'root' path if necessary.
def testMissingTempRoot(self):
RepositoryIndexFile cannot be given a missing 'temp_root'.
def testRemoveOld(self):
RepositoryIndexFile removes old index files.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.