~apachelogger/software-properties/python-apt-is-like

« back to all changes in this revision

Viewing changes to tests/test_dbus.py

  • Committer: Dimitri John Ledkov
  • Date: 2016-09-21 11:45:53 UTC
  • Revision ID: xnox@ubuntu.com-20160921114553-v6xo202os2tmkz7b
Port AptAuth.py from gpg command parsing to apt-key command
parsing. Simplifies invocations, and allows for proper handling of
simplified apt-secure(8) implementation with key fragments in
/etc/apt/trusted.gpg.d. Make the code gnupg1 and gnupg2
compatible. Display long keyids in the UI (i.e. anti-evil32 keys
feature). Revert dependency on gnupg1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
310
310
        # remove the key 
311
311
        res = self.iface.RemoveKey("D732CA59")
312
312
        self.assertTrue(res)
313
 
        self.assertEqual(os.path.getsize(trusted_gpg), 0)
 
313
        if os.path.exists(trusted_gpg):
 
314
            self.assertEqual(os.path.getsize(trusted_gpg), 0)
314
315
        # add from data
315
316
        with open(testkey) as keyfile:
316
317
            data = keyfile.read()
321
322
        # remove the key 
322
323
        res = self.iface.RemoveKey("D732CA59")
323
324
        self.assertTrue(res)
324
 
        self.assertEqual(os.path.getsize(trusted_gpg), 0)
 
325
        if os.path.exists(trusted_gpg):        
 
326
            self.assertEqual(os.path.getsize(trusted_gpg), 0)
325
327
        # test nonsense
326
328
        res = self.iface.AddKeyFromData("nonsens")
327
329
        self.assertFalse(res)