[dak/master] Fix extract_component_from_section() and testcase.
Signed-off-by: Torsten Werner <twerner@debian.org>
---
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 133500c..8bc1b2c 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 e21c378..b389ad1 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,
)
--
1.7.2.5
Reply to: