summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-12-21 18:17:21 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2010-12-21 18:17:21 +0100
commitb4816b79b3ce90fdabed8e812fc8e6f7109d1de0 (patch)
tree01d97646f42519659e8fb831167db2c2865e8030 /tests
parentbebae32a598593f9d427d54cb48a84bd9beac227 (diff)
downloadpython-apt-b4816b79b3ce90fdabed8e812fc8e6f7109d1de0.tar.gz
* apt/debfile.py, tests/test_debfile.py:
- strip "./" from _get_content and add tests, this fixes a control file extraction bug in gdebi
Diffstat (limited to 'tests')
-rw-r--r--tests/test_debfile.py12
1 files changed, 11 insertions, 1 deletions
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)