X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=tests%2Ftest_process_gpgv_output.py;fp=tests%2Ftest_process_gpgv_output.py;h=0000000000000000000000000000000000000000;hb=90885e3cbeee73afe199d6c77cd8d4e58cedf5ac;hp=ea1fb337174c48f03e27f009a4c59950b4c9a698;hpb=3a7846025b1d282c0499373983eee641d8220cff;p=dak.git diff --git a/tests/test_process_gpgv_output.py b/tests/test_process_gpgv_output.py deleted file mode 100755 index ea1fb337..00000000 --- a/tests/test_process_gpgv_output.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python - -from base_test import DakTestCase - -import unittest - -from daklib.utils import process_gpgv_output - -class ProcessGPGVOutputTestCase(DakTestCase): - def assertParse(self, input, output): - self.assertEqual(process_gpgv_output(input)[0], output) - - def assertNotParse(self, input): - ret = process_gpgv_output(input) - self.assertNotEqual(len(ret[1]), 0) - - ## - - def testEmpty(self): - self.assertParse('', {}) - - def testBroken(self): - self.assertNotParse('foo') - self.assertNotParse(' foo ') - self.assertNotParse('[PREFIXPG:] KEY VAL1 VAL2 VAL3') - - def testSimple(self): - self.assertParse( - '[GNUPG:] KEY VAL1 VAL2 VAL3', - {'KEY': ['VAL1', 'VAL2', 'VAL3']}, - ) - - def testNoKeys(self): - self.assertParse('[GNUPG:] KEY', {'KEY': []}) - - def testDuplicate(self): - self.assertNotParse('[GNUPG:] TEST_KEY\n[GNUPG:] TEST_KEY') - self.assertNotParse('[GNUPG:] KEY VAL1\n[GNUPG:] KEY VAL2') - - def testDuplicateSpecial(self): - # NODATA and friends are special - for special in ('NODATA', 'SIGEXPIRED', 'KEYEXPIRED'): - self.assertParse( - '[GNUPG:] %s\n[GNUPG:] %s' % (special, special), - {special: []}, - ) - -if __name__ == '__main__': - unittest.main()