]> git.decadent.org.uk Git - dak.git/blobdiff - tests/test_parse_changes.py
dep11: Validate .xz compressed files as well
[dak.git] / tests / test_parse_changes.py
index 2a66f832a12cb867db0c43543d2832f13beae60e..c7193dbef1148379509b097bd1f928ff09933965 100755 (executable)
@@ -45,6 +45,21 @@ class ParseDscTestCase(ParseChangesTestCase):
         # Extra blank line after signature header
         self.assertParse('dsc/6.dsc', -1, 1)
 
+    def test_7(self):
+        # Blank file is an invalid armored GPG file
+        with self.assertRaises(GpgException):
+            self.assertParse('dsc/7.dsc', -1, 1)
+
+    def test_8(self):
+        # No armored contents
+        with self.assertRaisesRegexp(ParseChangesError, "Empty changes"):
+            self.assertParse('dsc/8.dsc', -1, 1)
+
+    def test_9(self):
+        changes = self.assertParse('dsc/9.dsc', -1, 1)
+        self.assert_(changes['question'] == 'Is this a bug?')
+        self.failIf(changes.get('this'))
+
 class ParseChangesTestCase(ParseChangesTestCase):
     def test_1(self):
         # Empty changes
@@ -67,10 +82,5 @@ class ParseChangesTestCase(ParseChangesTestCase):
                 )
                 self.failIf(changes.get('you'))
 
-    def test_4(self):
-        changes = self.assertParse('changes/two-beginnings.changes', -1, 1)
-        self.assert_(changes['question'] == 'Is this a bug?')
-        self.failIf(changes.get('this'))
-
 if __name__ == '__main__':
     unittest.main()