From: Torsten Werner Date: Wed, 27 Jul 2011 21:01:10 +0000 (+0200) Subject: Fix extract_component_from_section() and testcase. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a95c2b25c7bf4a55a78e273c2cb133ff93019306;p=dak Fix extract_component_from_section() and testcase. Signed-off-by: Torsten Werner --- diff --git a/daklib/utils.py b/daklib/utils.py index 133500c6..8bc1b2c7 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -138,7 +138,7 @@ def our_raw_input(prompt=""): ################################################################################ -def extract_component_from_section(section): +def extract_component_from_section(section, session=None): component = "" if section.find('/') != -1: @@ -146,11 +146,11 @@ def extract_component_from_section(section): # Expand default component if component == "": - comp = get_component(section) + comp = get_component(section, session) if comp is None: component = "main" else: - component = comp.componant_name + component = comp.component_name return (section, component) diff --git a/tests/dbtest_extract_component_from_section.py b/tests/dbtest_extract_component_from_section.py index e21c378e..b389ad1b 100755 --- a/tests/dbtest_extract_component_from_section.py +++ b/tests/dbtest_extract_component_from_section.py @@ -22,8 +22,9 @@ class ExtractComponentTestCase(DBDakTestCase): """ def assertExtract(self, input, output): + self.setup_components() self.assertEqual( - extract_component_from_section(input)[1], + extract_component_from_section(input, self.session)[1], output, )