]> err.no Git - dak/commitdiff
Move parse_format tests to test_formats.py
authorChris Lamb <lamby@debian.org>
Wed, 28 Oct 2009 16:09:42 +0000 (16:09 +0000)
committerChris Lamb <lamby@debian.org>
Wed, 28 Oct 2009 16:09:42 +0000 (16:09 +0000)
Signed-off-by: Chris Lamb <lamby@debian.org>
tests/test_formats.py [new file with mode: 0755]
tests/test_srcformats.py

diff --git a/tests/test_formats.py b/tests/test_formats.py
new file mode 100755 (executable)
index 0000000..8a2b1ad
--- /dev/null
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+
+import unittest
+
+import os, sys
+sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+
+from daklib.formats import parse_format
+from daklib.dak_exceptions import UnknownFormatError
+
+class ParseFormatTestCase(unittest.TestCase):
+    def assertParse(self, format, expected):
+        self.assertEqual(parse_format(format), expected)
+
+    def assertParseFail(self, format):
+        self.assertRaises(
+            UnknownFormatError,
+            lambda: parse_format(format)
+        )
+
+    def testParse(self):
+        self.assertParse('1.0', (1, 0))
+
+    def testEmpty(self):
+        self.assertParseFail('')
+        self.assertParseFail(' ')
+        self.assertParseFail('  ')
+
+    def textText(self):
+        self.assertParse('1.2 (three)', (1, 2, 'three'))
+        self.assertParseFail('0.0 ()')
index 1e78981b6a9ec45dc3c5cbb4a7bf5b37a0881d02..9bc0ddf236dd064e434daa832ffcb05e17dda465 100755 (executable)
@@ -106,28 +106,6 @@ class FormatTreeQuiltTestCase(SourceFormatTestCase):
 
 ##
 
-class ParseFormatTestCase(unittest.TestCase):
-    def assertParse(self, format, expected):
-        self.assertEqual(parse_format(format), expected)
-
-    def assertParseFail(self, format):
-        self.assertRaises(
-            UnknownFormatError,
-            lambda: parse_format(format)
-        )
-
-    def testParse(self):
-        self.assertParse('1.0', (1, 0))
-
-    def testEmpty(self):
-        self.assertParseFail('')
-        self.assertParseFail(' ')
-        self.assertParseFail('  ')
-
-    def textText(self):
-        self.assertParse('1.2 (three)', (1, 2, 'three'))
-        self.assertParseFail('0.0 ()')
-
 class ValidateFormatTestCase(unittest.TestCase):
     def assertValid(self, format, **kwargs):
         kwargs['is_a_dsc'] = kwargs.get('is_a_dsc', True)