~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_verify_signatures.py

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:13:13 UTC
  • mfrom: (6614.2.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201191313-wdfvmfff1djde6oq
(vila) Release 2.7.0 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 Canonical Ltd
 
1
# Copyright (C) 2013, 2016 Canonical Ltd
2
2
# -*- coding: utf-8 -*-
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
51
51
        self.monkey_patch_gpg()
52
52
        self.run_bzr('sign-my-commits')
53
53
        out = self.run_bzr('verify-signatures', retcode=1)
54
 
        self.assertEquals(('4 commits with valid signatures\n'
 
54
        self.assertEqual(('4 commits with valid signatures\n'
55
55
                           '0 commits with key now expired\n'
56
56
                           '0 commits with unknown keys\n'
57
57
                           '0 commits not valid\n'
63
63
        self.run_bzr('sign-my-commits')
64
64
        out = self.run_bzr(['verify-signatures', '--acceptable-keys=foo,bar'],
65
65
                            retcode=1)
66
 
        self.assertEquals(('4 commits with valid signatures\n'
 
66
        self.assertEqual(('4 commits with valid signatures\n'
67
67
                           '0 commits with key now expired\n'
68
68
                           '0 commits with unknown keys\n'
69
69
                           '0 commits not valid\n'
74
74
        self.monkey_patch_gpg()
75
75
        self.run_bzr('sign-my-commits')
76
76
        out = self.run_bzr('verify-signatures --verbose', retcode=1)
77
 
        self.assertEquals(('4 commits with valid signatures\n'
78
 
                           '  None signed 4 commits\n'
79
 
                           '0 commits with key now expired\n'
80
 
                           '0 commits with unknown keys\n'
81
 
                           '0 commits not valid\n'
82
 
                           '1 commit not signed\n'
83
 
                           '  1 commit by author Alternate <alt@foo.com>\n', ''), out)
 
77
        self.assertEqual(
 
78
            ('4 commits with valid signatures\n'
 
79
             '  None signed 4 commits\n'
 
80
             '0 commits with key now expired\n'
 
81
             '0 commits with unknown keys\n'
 
82
             '0 commits not valid\n'
 
83
             '1 commit not signed\n'
 
84
             '  1 commit by author Alternate <alt@foo.com>\n', ''), out)
84
85
 
85
86
    def test_verify_signatures_verbose_all_valid(self):
86
87
        wt = self.setup_tree()
88
89
        self.run_bzr('sign-my-commits')
89
90
        self.run_bzr(['sign-my-commits', '.', 'Alternate <alt@foo.com>'])
90
91
        out = self.run_bzr('verify-signatures --verbose')
91
 
        self.assertEquals(('All commits signed with verifiable keys\n'
92
 
                           '  None signed 5 commits\n', ''), out)
 
92
        self.assertEqual(('All commits signed with verifiable keys\n'
 
93
                          '  None signed 5 commits\n', ''), out)
93
94
 
94
95
 
95
96
class TestSmartServerVerifySignatures(tests.TestCaseWithTransport):