summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2010-12-22 11:11:10 +0100
committerMichael Vogt <mvo@debian.org>2010-12-22 11:11:10 +0100
commitd3d1874886839dabdabeab94ccee7b1fb449c66e (patch)
tree5ad17ad8dc07c02af00a4fc24e34896f7f2442e2 /tests
parent674f6c2e21b8f59a6a23089eb8da5f210f865bc2 (diff)
parent33dd13058d468772153e3182c7d8b126f1e0f6ba (diff)
downloadpython-apt-d3d1874886839dabdabeab94ccee7b1fb449c66e.tar.gz
merged from lp:~mvo/python-apt/mvo
Diffstat (limited to 'tests')
-rw-r--r--tests/test_apt_cache.py6
-rw-r--r--tests/test_debfile.py12
2 files changed, 14 insertions, 4 deletions
diff --git a/tests/test_apt_cache.py b/tests/test_apt_cache.py
index 0b33a2e3..cfb3ab99 100644
--- a/tests/test_apt_cache.py
+++ b/tests/test_apt_cache.py
@@ -59,13 +59,13 @@ class TestAptCache(unittest.TestCase):
self.assertTrue(len(l) > 0)
self.assertTrue("postfix" in [p.name for p in l])
# this is a not virtual (transitional) package provided by another
- l = cache.get_providing_packages("scrollkeeper")
+ l = cache.get_providing_packages("git-core")
self.assertEqual(l, [])
# now inlcude nonvirtual packages in the search (rarian-compat
# provides scrollkeeper)
- l = cache.get_providing_packages("scrollkeeper",
+ l = cache.get_providing_packages("git-core",
include_nonvirtual=True)
- self.assertTrue(len(l), 1)
+ self.assertEqual([p.name for p in l], ["git"])
self.assertTrue("mail-transport-agent" in cache["postfix"].candidate.provides)
def test_low_level_pkg_provides(self):
diff --git a/tests/test_debfile.py b/tests/test_debfile.py
index 759639c4..712c4958 100644
--- a/tests/test_debfile.py
+++ b/tests/test_debfile.py
@@ -100,7 +100,17 @@ class TestDebfilee(unittest.TestCase):
deb.open(os.path.join("data", "test_debs", "gdebi-test12.deb"))
content = deb.data_content("usr/bin/binary")
self.assertTrue(content.startswith("Automatically converted to printable ascii:\n\x7fELF "))
-
+ # control file
+ needle = """Package: gdebi-test12
+Version: 1.0
+Architecture: all
+Description: testpackage for gdebi - contains usr/bin/binary for file reading
+ This tests the binary file reading for debfile.py
+"""
+ content = deb.control_content("./control")
+ self.assertEqual(content, needle)
+ content = deb.control_content("control")
+ self.assertEqual(content, needle)
if __name__ == "__main__":
#logging.basicConfig(level=logging.DEBUG)