From a95c2b25c7bf4a55a78e273c2cb133ff93019306 Mon Sep 17 00:00:00 2001 From: Torsten Werner Date: Wed, 27 Jul 2011 23:01:10 +0200 Subject: [PATCH] Fix extract_component_from_section() and testcase. Signed-off-by: Torsten Werner --- daklib/utils.py | 6 +++--- tests/dbtest_extract_component_from_section.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) 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, ) -- 2.39.5