]> git.decadent.org.uk Git - dak.git/commitdiff
Move test case for extract_component to be a db test
authorMark Hymers <mhy@debian.org>
Wed, 27 Jul 2011 11:52:24 +0000 (12:52 +0100)
committerMark Hymers <mhy@debian.org>
Wed, 27 Jul 2011 11:52:24 +0000 (12:52 +0100)
Signed-off-by: Mark Hymers <mhy@debian.org>
tests/dbtest_extract_component_from_section.py [new file with mode: 0755]
tests/fixtures/dak.conf
tests/test_extract_component_from_section.py [deleted file]

diff --git a/tests/dbtest_extract_component_from_section.py b/tests/dbtest_extract_component_from_section.py
new file mode 100755 (executable)
index 0000000..e21c378
--- /dev/null
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+
+from db_test import DBDakTestCase
+
+import unittest
+
+from daklib.utils import extract_component_from_section
+
+class ExtractComponentTestCase(DBDakTestCase):
+    """
+    prefix: non-US
+    component: main, contrib, non-free
+    section: games, admin, libs, [...]
+
+    [1] Order is as above.
+    [2] Prefix is optional for the default archive, but mandatory when
+        uploads are going anywhere else.
+    [3] Default component is main and may be omitted.
+    [4] Section is optional.
+    [5] Prefix is case insensitive
+    [6] Everything else is case sensitive.
+    """
+
+    def assertExtract(self, input, output):
+        self.assertEqual(
+            extract_component_from_section(input)[1],
+            output,
+        )
+
+    def test_1(self):
+        # Validate #3
+        self.assertExtract('utils', 'main')
+
+    def test_2(self):
+        # Err, whoops?  should probably be 'utils', 'main'...
+        self.assertExtract('main/utils', 'main')
+
+    def test_3(self):
+        self.assertExtract('non-free/libs', 'non-free')
+
+    def test_4(self):
+        self.assertExtract('contrib/net', 'contrib')
+
+    def test_5(self):
+        # Validate #4
+        self.assertExtract('main', 'main')
+
+    def test_6(self):
+        self.assertExtract('contrib', 'contrib')
+
+    def test_7(self):
+        self.assertExtract('non-free', 'non-free')
+
+    def test_8(self):
+        # Validate #6 (section)
+        self.assertExtract('utIls', 'main')
+
+if __name__ == '__main__':
+    unittest.main()
index 3a728f78c1a0911ae74cb62fbab32b32a5a60d66..ec88cc1f4a57eafb37f1557bc8a4591b89b97cc7 100644 (file)
@@ -1,23 +1,3 @@
-// For extract_component_from_section tests
-
-Component
-{
-  main
-  {
-       Description "Main";
-  };
-
-  contrib
-  {
-       Description "Contrib";
-  };
-
-  non-free
-  {
-       Description "Software that fails to meet the DFSG";
-  };
-};
-
 Dir
 {
   Root "tests/fixtures/ftp/";
diff --git a/tests/test_extract_component_from_section.py b/tests/test_extract_component_from_section.py
deleted file mode 100755 (executable)
index 3493f41..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/env python
-
-from base_test import DakTestCase
-
-import unittest
-
-from daklib.utils import extract_component_from_section
-
-class ExtractComponentTestCase(DakTestCase):
-    """
-    prefix: non-US
-    component: main, contrib, non-free
-    section: games, admin, libs, [...]
-
-    [1] Order is as above.
-    [2] Prefix is optional for the default archive, but mandatory when
-        uploads are going anywhere else.
-    [3] Default component is main and may be omitted.
-    [4] Section is optional.
-    [5] Prefix is case insensitive
-    [6] Everything else is case sensitive.
-    """
-
-    def assertExtract(self, input, output):
-        self.assertEqual(
-            extract_component_from_section(input)[1],
-            output,
-        )
-
-    def test_1(self):
-        # Validate #3
-        self.assertExtract('utils', 'main')
-
-    def test_2(self):
-        # Err, whoops?  should probably be 'utils', 'main'...
-        self.assertExtract('main/utils', 'main')
-
-    def test_3(self):
-        self.assertExtract('non-free/libs', 'non-free')
-
-    def test_4(self):
-        self.assertExtract('contrib/net', 'contrib')
-
-    def test_5(self):
-        # Validate #4
-        self.assertExtract('main', 'main')
-
-    def test_6(self):
-        self.assertExtract('contrib', 'contrib')
-
-    def test_7(self):
-        self.assertExtract('non-free', 'non-free')
-
-    def test_8(self):
-        # Validate #6 (section)
-        self.assertExtract('utIls', 'main')
-
-if __name__ == '__main__':
-    unittest.main()