[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] 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 1af05b7..04a0ef5 100644
--- a/daklib/packagelist.py
+++ b/daklib/packagelist.py
@@ -90,7 +90,7 @@ class PackageList(object):
             # <name> <type> <component/section> <priority> [arch=<arch>[,<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 9259e73..fa5cc86 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)
 
-- 
1.7.10.4


Reply to: