]> git.decadent.org.uk Git - dak.git/blobdiff - tests/test_srcformats.py
Move parse_format tests to test_formats.py
[dak.git] / tests / test_srcformats.py
index f6d7215fc8daabcd179543ff59691263ccbb9d23..9bc0ddf236dd064e434daa832ffcb05e17dda465 100755 (executable)
@@ -8,6 +8,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 from collections import defaultdict
 
 from daklib import srcformats
+from daklib.formats import parse_format
 from daklib.dak_exceptions import UnknownFormatError
 
 class SourceFormatTestCase(unittest.TestCase):
@@ -105,28 +106,6 @@ class FormatTreeQuiltTestCase(SourceFormatTestCase):
 
 ##
 
-class ParseFormatTestCase(unittest.TestCase):
-    def assertParse(self, format, expected):
-        self.assertEqual(srcformats.parse_format(format), expected)
-
-    def assertParseFail(self, format):
-        self.assertRaises(
-            UnknownFormatError,
-            lambda: srcformats.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)