~ubuntu-branches/ubuntu/natty/aptdaemon/natty-security

« back to all changes in this revision

Viewing changes to tests/test_worker.py

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2011-04-12 13:25:49 UTC
  • mfrom: (1.1.47 upstream)
  • Revision ID: james.westby@ubuntu.com-20110412132549-8rc74dfr01jil7vm
Tags: 0.41+bzr629-0ubuntu1
* New bzr bugfix snapshot:
  - improve utf8 encoding handling tests
  - lp:~mvo/aptdaemon/relax-lintian-checks merged
  - improve terminal handling, LP: #741260, #693290, #741260,  
    #738056,  #742780, #743818, #744444, #746727, #747539, #753700,
    #753762, #753927, #754134, #754174, #754205, #754206, #754220
  - fix refactoring lefovers (LP: #752220)
  - don't segfault if we cannot read the status of the process holding 
    a lock (LP: #745517)
* debian/patches/01_relax_lintian_checks.patch:
  - removed, taken upstream
* debian/patches/02_fix_unicode_in_convert_struct.patch:
  - removed, taken usptream
* debian/patches/04_import_logging.patch:
  - removed, fixed usptream

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
__author__  = "Sebastian Heinlein <devel@glatzor.de>"
24
24
 
 
25
import glob
25
26
import os
 
27
import shutil
26
28
import unittest2
27
29
 
28
30
import dbus
229
231
 
230
232
    def test_install_file(self):
231
233
        """Test the installation of a local package file."""
 
234
        # add custom lintian file
 
235
        target = os.path.join(self.chroot.path, "usr", "share", "aptdaemon")
 
236
        os.makedirs(target)
 
237
        for tags_file in glob.glob(os.path.join(aptdaemon.test.get_tests_dir(),
 
238
                                                "../data/lintian*tags*")):
 
239
            shutil.copy(tags_file, target)
 
240
        # test
232
241
        self.chroot.add_test_repository()
233
 
        pkg = os.path.join(REPO_PATH, "silly-depend-base_0.1-0_all.deb")
 
242
        pkg = os.path.join(
 
243
            REPO_PATH, "silly-depend-base-lintian-broken_0.1-0_all.deb")
234
244
        trans = Transaction(enums.ROLE_INSTALL_FILE, self.queue, os.getuid(),
235
245
                            "org.debian.apt.test", bus=self.dbus,
236
246
                            kwargs={"path": os.path.join(REPO_PATH, pkg),
253
263
                         "%s: %s" % (trans._error_property[0],
254
264
                                     trans._error_property[1]))
255
265
        self.worker._cache.open()
256
 
        self.assertTrue(self.worker._cache["silly-depend-base"].is_installed)
 
266
        self.assertTrue(self.worker._cache["silly-depend-base-lintian-broken"].is_installed)
257
267
 
258
268
    def test_install_unknown_file(self):
259
269
        """Test the installation of a local package file which is not known