示例#1
0
    def test_delete_repo_file(self):
        """
        Tests that calling delete_repo_file deletes the repo file.
        """

        # Setup
        repolib.bind(TEST_REPO_FILENAME, TEST_MIRROR_LIST_FILENAME, TEST_KEYS_DIR, TEST_CERT_DIR, REPO_ID, REPO_NAME, ['http://pulp'], {}, None, None, ENABLED, LOCK)
        self.assertTrue(os.path.exists(TEST_REPO_FILENAME))

        # Test
        repolib.delete_repo_file(TEST_REPO_FILENAME, LOCK)

        # Verify
        self.assertFalse(os.path.exists(TEST_REPO_FILENAME))
示例#2
0
 def clean(self, conduit):
     """
     Clean up artifacts associated with the handler.
     @param conduit: A handler conduit.
     @type conduit: L{pulp.agent.lib.conduit.Conduit}
     @return: A clean report.
     @rtype: L{CleanReport}
     """
     log.info('clean')
     report = CleanReport()
     cfg = conduit.get_consumer_config().graph()
     repolib.delete_repo_file(cfg.filesystem.repo_file)
     report.set_succeeded()
     return report