~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2014-04-11 02:21:29 UTC
  • mfrom: (6583.4.5 fix-1123460)
  • Revision ID: pqm@pqm.ubuntu.com-20140411022129-msotfyulqna1qc4m
(richard-wilbur) Fix bug LP: #1123460,
 verify-signature crashes on non ascii characters (and on -v) (Reagan Sanders)

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
        self.assertUnsigned(repo, 'D')
117
117
        self.assertUnsigned(repo, 'E')
118
118
 
119
 
    def test_verify_commits(self):
120
 
        wt = self.setup_tree()
121
 
        self.monkey_patch_gpg()
122
 
        self.run_bzr('sign-my-commits')
123
 
        out = self.run_bzr('verify-signatures', retcode=1)
124
 
        self.assertEquals(('4 commits with valid signatures\n'
125
 
                           '0 commits with key now expired\n'
126
 
                           '0 commits with unknown keys\n'
127
 
                           '0 commits not valid\n'
128
 
                           '1 commit not signed\n', ''), out)
129
 
 
130
 
    def test_verify_commits_acceptable_key(self):
131
 
        wt = self.setup_tree()
132
 
        self.monkey_patch_gpg()
133
 
        self.run_bzr('sign-my-commits')
134
 
        out = self.run_bzr(['verify-signatures', '--acceptable-keys=foo,bar'],
135
 
                            retcode=1)
136
 
        self.assertEquals(('4 commits with valid signatures\n'
137
 
                           '0 commits with key now expired\n'
138
 
                           '0 commits with unknown keys\n'
139
 
                           '0 commits not valid\n'
140
 
                           '1 commit not signed\n', ''), out)
141
 
 
142
119
 
143
120
class TestSmartServerSignMyCommits(tests.TestCaseWithTransport):
144
121
 
168
145
        self.assertLength(15, self.hpss_calls)
169
146
        self.assertLength(1, self.hpss_connections)
170
147
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
171
 
 
172
 
    def test_verify_commits(self):
173
 
        self.setup_smart_server_with_call_log()
174
 
        t = self.make_branch_and_tree('branch')
175
 
        self.build_tree_contents([('branch/foo', 'thecontents')])
176
 
        t.add("foo")
177
 
        t.commit("message")
178
 
        self.monkey_patch_gpg()
179
 
        out, err = self.run_bzr(['sign-my-commits', self.get_url('branch')])
180
 
        self.reset_smart_call_log()
181
 
        self.run_bzr('sign-my-commits')
182
 
        out = self.run_bzr(['verify-signatures', self.get_url('branch')])
183
 
        # This figure represent the amount of work to perform this use case. It
184
 
        # is entirely ok to reduce this number if a test fails due to rpc_count
185
 
        # being too low. If rpc_count increases, more network roundtrips have
186
 
        # become necessary for this use case. Please do not adjust this number
187
 
        # upwards without agreement from bzr's network support maintainers.
188
 
        self.assertLength(10, self.hpss_calls)
189
 
        self.assertLength(1, self.hpss_connections)
190
 
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)