]> git.decadent.org.uk Git - dak.git/commitdiff
Fix extract_component_from_section() and testcase.
authorTorsten Werner <twerner@debian.org>
Wed, 27 Jul 2011 21:01:10 +0000 (23:01 +0200)
committerTorsten Werner <twerner@debian.org>
Wed, 27 Jul 2011 21:01:10 +0000 (23:01 +0200)
Signed-off-by: Torsten Werner <twerner@debian.org>
daklib/utils.py
tests/dbtest_extract_component_from_section.py

index 133500c66fc90883a6be95c6b535fbb6302fee78..8bc1b2c7c2c4db01405b6d375e8e30d2fb8981ad 100755 (executable)
@@ -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)
 
index e21c378e40a5c9a717b41b6949ed278adc6185d8..b389ad1b4d8f45679fa7eac61fb7b68781ea1697 100755 (executable)
@@ -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,
         )