X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=tests%2Ftest_srcformats.py;h=4ecaf8b7fcc83925238f2473ed7961714158eee2;hb=24c271a827eb5ffecf4f000868b604c564e622a7;hp=9bc0ddf236dd064e434daa832ffcb05e17dda465;hpb=ef55b8c79ae2d3e593aacb7a1f4a3c893bf62094;p=dak.git diff --git a/tests/test_srcformats.py b/tests/test_srcformats.py index 9bc0ddf2..4ecaf8b7 100755 --- a/tests/test_srcformats.py +++ b/tests/test_srcformats.py @@ -104,67 +104,6 @@ class FormatTreeQuiltTestCase(SourceFormatTestCase): 'native_tar': 1, }) -## - -class ValidateFormatTestCase(unittest.TestCase): - def assertValid(self, format, **kwargs): - kwargs['is_a_dsc'] = kwargs.get('is_a_dsc', True) - self.fmt.validate_format(format, **kwargs) - - def assertInvalid(self, *args, **kwargs): - self.assertRaises( - UnknownFormatError, - lambda: self.assertValid(*args, **kwargs), - ) - -class ValidateFormatOneTestCase(ValidateFormatTestCase): - fmt = srcformats.FormatOne - - def testValid(self): - self.assertValid((1, 0)) - - def testInvalid(self): - self.assertInvalid((0, 1)) - self.assertInvalid((3, 0, 'quilt')) - - ## - - def testBinary(self): - self.assertValid((1, 5), is_a_dsc=False) - self.assertInvalid((1, 0), is_a_dsc=False) - - def testRange(self): - self.assertInvalid((1, 3), is_a_dsc=False) - self.assertValid((1, 5), is_a_dsc=False) - self.assertValid((1, 8), is_a_dsc=False) - self.assertInvalid((1, 9), is_a_dsc=False) - - def testFilesField(self): - self.assertInvalid((1, 7), is_a_dsc=False, field='notfiles') - self.assertValid((1, 8), is_a_dsc=False, field='notfiles') - -class ValidateFormatThreeTestCase(ValidateFormatTestCase): - fmt = srcformats.FormatThree - - def testValid(self): - self.assertValid((3, 0, 'native')) - - def testInvalid(self): - self.assertInvalid((1, 0)) - self.assertInvalid((0, 0)) - self.assertInvalid((3, 0, 'quilt')) - -class ValidateFormatThreeQuiltTestCase(ValidateFormatTestCase): - fmt = srcformats.FormatThreeQuilt - - def testValid(self): - self.assertValid((3, 0, 'quilt')) - - def testInvalid(self): - self.assertInvalid((1, 0)) - self.assertInvalid((0, 0)) - self.assertInvalid((3, 0, 'native')) - class FormatFromStringTestCase(unittest.TestCase): def assertFormat(self, txt, klass): self.assertEqual(srcformats.get_format_from_string(txt), klass)