~mvo/aptdaemon/lp1044900

« back to all changes in this revision

Viewing changes to tests/test_worker.py

  • Committer: Sebastian Heinlein
  • Date: 2012-06-17 11:10:11 UTC
  • Revision ID: devel@glatzor.de-20120617111011-vhad9uo152woe12s
lintian supports skipping user profiles since 2.5.9

If $HOME is unset custom profiles of the user will be skipped. Make use of this.
Unfortunately we need  a complete LINTIAN_ROOT for the test case - so we have to copy it around.

Show diffs side-by-side

added added

removed removed

Lines of Context:
288
288
    def test_install_file(self):
289
289
        """Test the installation of a local package file."""
290
290
        # add custom lintian file
291
 
        os.environ["APTDAEMON_LINTIAN_HOME"] = self.chroot.path
292
 
        self.addCleanup(os.putenv, "APTDAEMON_LINTIAN_HOME", "")
293
 
        os.makedirs(os.path.join(self.chroot.path, ".lintian/profiles/"))
 
291
        lintian_root = os.path.join(self.chroot.path, "lintian")
 
292
        os.environ["LINTIAN_ROOT"] = lintian_root
 
293
        self.addCleanup(os.unsetenv, "LINTIAN_ROOT")
 
294
        import pdb; pdb.set_trace()
 
295
        shutil.copytree("/usr/share/lintian", lintian_root)
294
296
        for profile in glob.glob(os.path.join(aptdaemon.test.get_tests_dir(),
295
 
                                                "../data/lintian/*")):
296
 
            shutil.copytree(profile,
297
 
                            os.path.join(self.chroot.path,
298
 
                                         ".lintian/profiles",
299
 
                                         os.path.basename(profile)))
 
297
                                                "../data/lintian/*/*.profile")):
 
298
            dst = [lintian_root, "profiles"]
 
299
            dst.extend(profile.split("/")[-2:])
 
300
            shutil.copy(profile, os.path.join(*dst))
300
301
        # test
301
302
        self.chroot.add_test_repository()
302
303
        pkg = os.path.join(REPO_PATH,