Esempio n. 1
0
 def test_get_backports(self):
     """Test checking for backports."""
     self._catch_callbacks("package")
     self.backend.package("silly-base;0.1-0update1;all;", enums.INFO_ENHANCEMENT, "working package")
     self.backend.finished()
     self.mox.ReplayAll()
     self.chroot.add_repository(os.path.join(get_tests_dir(), "repo/backports"))
     self.backend._open_cache()
     self.backend.dispatch_command("get-updates", ["None"])
Esempio n. 2
0
 def test_get_security_updates(self):
     """Test checking for security updates."""
     self._catch_callbacks("package")
     self.backend.package("silly-base;0.1-0update1;all;Debian-Security", enums.INFO_SECURITY, "working package")
     self.backend.finished()
     self.mox.ReplayAll()
     self.chroot.add_repository(os.path.join(get_tests_dir(), "repo/security"))
     self.backend._open_cache()
     self.backend.dispatch_command("get-updates", ["None"])
Esempio n. 3
0
 def test_get_backports(self):
     """Test checking for backports."""
     self._catch_callbacks("package")
     self.backend.package("silly-base;0.1-0update1;all;",
                          enums.INFO_ENHANCEMENT, "working package")
     self.backend.finished()
     self.mox.ReplayAll()
     self.chroot.add_repository(
         os.path.join(get_tests_dir(), "repo/backports"))
     self.backend._open_cache()
     self.backend.dispatch_command("get-updates", ["None"])
Esempio n. 4
0
 def test_get_security_updates(self):
     """Test checking for security updates."""
     self._catch_callbacks("package")
     self.backend.package("silly-base;0.1-0update1;all;Debian-Security",
                          enums.INFO_SECURITY, "working package")
     self.backend.finished()
     self.mox.ReplayAll()
     self.chroot.add_repository(
         os.path.join(get_tests_dir(), "repo/security"))
     self.backend._open_cache()
     self.backend.dispatch_command("get-updates", ["None"])
Esempio n. 5
0
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Licensed under the GNU General Public License Version 2

__author__ = "Sebastian Heinlein <*****@*****.**>"

import os
import unittest

import apt_pkg
import mox

from core import get_tests_dir, Chroot
from packagekit import enums
import aptBackend

REPO_PATH = os.path.join(get_tests_dir(), "repo")


class GetUpdatesTests(mox.MoxTestBase):
    """Test cases for detecting available updates."""
    def setUp(self):
        mox.MoxTestBase.setUp(self)
        self.chroot = Chroot()
        self.chroot.setup()
        self.chroot.install_debfile(
            os.path.join(REPO_PATH, "silly-base_0.1-0_all.deb"))
        self.addCleanup(self.chroot.remove)
        self.backend = aptBackend.PackageKitAptBackend([])

    def _catch_callbacks(self, *args):
        methods = list(args)
Esempio n. 6
0
__author__  = "Sebastian Heinlein <*****@*****.**>"

import glob
import os
import shutil
import unittest

import apt_pkg
import mox

from core import get_tests_dir, Chroot
from packagekit import enums
import aptBackend

REPO_PATH = os.path.join(get_tests_dir(), "repo")


class CacheModifiersTests(mox.MoxTestBase):

    """Test cases for cache modifying methods of the APT backend.

    Note: In the test environment we emit the finished signal in the
          case of errors, too.
    """

    def setUp(self):
        mox.MoxTestBase.setUp(self)
        self.chroot = Chroot()
        self.chroot.setup()
        self.addCleanup(self.chroot.remove)