From d92f3e09718a6712554d770ced860cd4712bb941 Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Fri, 1 Aug 2014 00:51:57 +0200 Subject: [PATCH] PackageList: use correct values for section and component --- daklib/packagelist.py | 2 +- tests/test_packagelist.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/daklib/packagelist.py b/daklib/packagelist.py index 1af05b76..04a0ef51 100644 --- a/daklib/packagelist.py +++ b/daklib/packagelist.py @@ -90,7 +90,7 @@ class PackageList(object): # [arch=[,]...] name = fields[0] package_type = fields[1] - component, section = extract_component_from_section(fields[2]) + section, component = extract_component_from_section(fields[2]) priority = fields[3] other = dict(kv.split('=', 1) for kv in fields[4:]) diff --git a/tests/test_packagelist.py b/tests/test_packagelist.py index 9259e739..fa5cc86a 100644 --- a/tests/test_packagelist.py +++ b/tests/test_packagelist.py @@ -81,6 +81,14 @@ class TestPackageList(DakTestCase): p_all_amd64 = pl.packages_for_suite(suite_all_amd64) self.assertEqual(len(p_all_amd64), 1) + p = p_all[0] + self.assertEqual(p.name, 'libdune-common-doc') + self.assertEqual(p.type, 'deb') + self.assertEqual(p.section, 'doc') + self.assertEqual(p.component, 'main') + self.assertEqual(p.priority, 'optional') + self.assertEqual(p.architectures, ['all']) + def testArchAny(self): pl = PackageList(source_any) -- 2.39.5