summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-09-02 16:55:43 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-09-02 16:55:43 +0200
commit0d622864bf45b2826335b3be31330829f43db7cd (patch)
tree96578b8054647465b00eda526b4a5f3ca58523d8 /tests
parent96476d01e881f52d53a70f1ae700594a0f321056 (diff)
downloadpython-apt-0d622864bf45b2826335b3be31330829f43db7cd.tar.gz
merged patch from Samuel Lidén Borell to fix crash if there utf8
in the control file (LP: #624290) and add test
Diffstat (limited to 'tests')
-rw-r--r--tests/data/test_debs/utf8-package_1.0-1_all.debbin0 -> 1150 bytes
-rw-r--r--tests/test_debfile.py7
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/data/test_debs/utf8-package_1.0-1_all.deb b/tests/data/test_debs/utf8-package_1.0-1_all.deb
new file mode 100644
index 00000000..e0339c2e
--- /dev/null
+++ b/tests/data/test_debs/utf8-package_1.0-1_all.deb
Binary files differ
diff --git a/tests/test_debfile.py b/tests/test_debfile.py
index 42cda6f6..571c2ec9 100644
--- a/tests/test_debfile.py
+++ b/tests/test_debfile.py
@@ -1,4 +1,5 @@
#!/usr/bin/python
+# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Michael Vogt <mvo@ubuntu.com>
#
@@ -77,6 +78,12 @@ class TestDebfilee(unittest.TestCase):
"Unexpected result for package '%s' (got %s wanted %s)\n%s" % (
filename, res, expected_res, deb._failure_string))
+ def test_utf8_sections(self):
+ deb = apt.debfile.DebPackage(cache=self.cache)
+ deb.open(os.path.join("data","test_debs","utf8-package_1.0-1_all.deb"))
+ self.assertEqual(deb["Maintainer"],
+ "Samuel Lidén Borell <samuel@slbdata.se>")
+
def testContent(self):
# normal
deb = apt.debfile.DebPackage(cache=self.cache)