From 26df12182f990fcf0d269746a95f462fb479c7ac Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@canonical.com>
Date: Wed, 1 Jul 2015 15:49:06 +0200
Subject: [PATCH] Store Testsuite: list in sources

Extend read_sources to store the components of Testsuite: as a list.
---
 britney.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/britney.py b/britney.py
index f3f1986..b248050 100755
--- a/britney.py
+++ b/britney.py
@@ -235,14 +235,17 @@ check_fields = sorted(check_field_name)
 
 class SourcePackage(object):
 
-    __slots__ = ['version', 'section', 'binaries', 'maintainer', 'is_fakesrc']
+    __slots__ = ['version', 'section', 'binaries', 'maintainer', 'is_fakesrc',
+                'testsuite']
 
-    def __init__(self, version, section, binaries, maintainer, is_fakesrc):
+    def __init__(self, version, section, binaries, maintainer, is_fakesrc,
+                 testsuite):
         self.version = version
         self.section = section
         self.binaries = binaries
         self.maintainer = maintainer
         self.is_fakesrc = is_fakesrc
+        self.testsuite = testsuite
 
     def __getitem__(self, item):
         return getattr(self, self.__slots__[item])
@@ -583,6 +586,7 @@ class Britney(object):
                         [],
                         None,
                         True,
+                        [],
                         )
 
             self.sources['testing'][pkg_name] = src_data
@@ -657,6 +661,7 @@ class Britney(object):
                         [],
                         None,
                         True,
+                        [],
                         )
             self.sources['testing'][pkg_name] = src_data
             self.sources['unstable'][pkg_name] = src_data
@@ -838,6 +843,7 @@ class Britney(object):
                             [],
                             maint,
                             False,
+                            get_field('Testsuite', '').split(),
                             )
         return sources
 
@@ -987,7 +993,7 @@ class Britney(object):
                     srcdist[source].binaries.append(pkg_id)
             # if the source package doesn't exist, create a fake one
             else:
-                srcdist[source] = SourcePackage(source_version, 'faux', [pkg_id], None, True)
+                srcdist[source] = SourcePackage(source_version, 'faux', [pkg_id], None, True, [])
 
             # add the resulting dictionary to the package list
             packages[pkg] = dpkg