コード例 #1
0
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
"""Unit tests for verifying the correctness of apt_pkg.TagFile"""

from __future__ import print_function, unicode_literals

import io
import glob
import os
import shutil
import sys
import tempfile
import unittest

from test_all import get_library_dir
libdir = get_library_dir()
if libdir:
    sys.path.insert(0, libdir)

import apt_pkg


class TestTagFile(unittest.TestCase):
    """ test the apt_pkg.TagFile """
    def setUp(self):
        apt_pkg.init()
        self.temp_dir = tempfile.mkdtemp()

    def tearDown(self):
        shutil.rmtree(self.temp_dir)
コード例 #2
0
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Michael Vogt <*****@*****.**>
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
"""Unit tests for verifying the correctness of DebPackage in apt.debfile."""
import os
import logging
import unittest

from test_all import get_library_dir
import sys
sys.path.insert(0, get_library_dir())
import apt_pkg
import apt.debfile

class TestDebfile(unittest.TestCase):
    """ test the debfile """

    TEST_DEBS = [
        # conflicts with apt
        ('gdebi-test1.deb', False),
        # impossible dependency
        ('gdebi-test2.deb', False),
        #  or-group (impossible-dependency|apt)
        ('gdebi-test3.deb', True),
        # Conflicts: apt (<= 0.1)
        ('gdebi-test4.deb', True),
コード例 #3
0
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
"""Unit tests for verifying the correctness of apt_pkg.TagFile"""

from __future__ import print_function, unicode_literals

import io
import glob
import os
import shutil
import sys
import tempfile
import unittest

from test_all import get_library_dir
libdir = get_library_dir()
if libdir:
    sys.path.insert(0, libdir)

import apt_pkg

import testcommon


class TestOpenMaybeClearSigned(testcommon.TestCase):

    def test_open_trivial(self):
        basepath = os.path.dirname(__file__)
        fd = apt_pkg.open_maybe_clear_signed_file(
            os.path.join(basepath, "./data/test_debs/hello_2.5-1.dsc"))
        with os.fdopen(fd) as f:
コード例 #4
0
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
"""Unit tests for verifying the correctness of apt_pkg.TagFile"""

from __future__ import print_function, unicode_literals

import io
import glob
import os
import shutil
import sys
import tempfile
import unittest

from test_all import get_library_dir
sys.path.insert(0, get_library_dir())

import apt_pkg


class TestTagFile(unittest.TestCase):
    """ test the apt_pkg.TagFile """
    def setUp(self):
        apt_pkg.init()
        self.temp_dir = tempfile.mkdtemp()

    def tearDown(self):
        shutil.rmtree(self.temp_dir)

    def test_tag_file(self):
        basepath = os.path.dirname(__file__)