~ursinha/lp-qa-tools/bzr-tarmacland

« back to all changes in this revision

Viewing changes to test_pqm_submit.py

  • Committer: Andrew Bennetts
  • Date: 2009-11-24 04:18:19 UTC
  • mfrom: (60.1.1 fix-tests)
  • Revision ID: andrew.bennetts@canonical.com-20091124041819-dwajczr20n7f5hxh
Merge fix-tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
User-Agent: Bazaar \(.*\)
34
34
 
35
35
-----BEGIN PSEUDO-SIGNED CONTENT-----
36
 
star-merge .*/public/ http://example.com/submit
 
36
star-merge .*/public/ .*/submit/
37
37
-----END PSEUDO-SIGNED CONTENT-----
38
38
"""
39
39
 
242
242
 
243
243
    def test_find_submit_branch(self):
244
244
        source_branch = self.make_branch('source')
245
 
        source_branch.set_submit_branch('http://example.com/submit')
 
245
        submit_transport = self.get_transport().clone('submit')
 
246
        submit_transport.ensure_base()
 
247
        source_branch.set_submit_branch(submit_transport.base)
246
248
 
247
249
        submission = pqm_submit.PQMSubmission(
248
250
            source_branch=source_branch,
249
251
            public_location='public-branch',
250
252
            message='commit message')
251
 
        self.assertEqual('http://example.com/submit',
252
 
                         submission.submit_location)
 
253
        self.assertEqual(submit_transport.base, submission.submit_location)
253
254
 
254
255
    def test_find_submit_branch_from_pqm_branch(self):
255
256
        # Test that submit_branch can be picked up from the obsolete
256
257
        # pqm_branch config option.
257
258
        source_branch = self.make_branch('source')
 
259
        submit_transport = self.get_transport().clone('submit')
 
260
        submit_transport.ensure_base()
258
261
        source_branch.get_config().set_user_option(
259
 
            'pqm_branch', 'http://example.com/submit')
 
262
            'pqm_branch', submit_transport.base)
260
263
        # pqm_branch is used in preference to the submit_branch:
261
264
        source_branch.set_submit_branch('bad-value')
262
265
 
264
267
            source_branch=source_branch,
265
268
            public_location='public-branch',
266
269
            message='commit message')
267
 
        self.assertEqual('http://example.com/submit',
268
 
                         submission.submit_location)
 
270
        self.assertEqual(submit_transport.base, submission.submit_location)
269
271
 
270
272
    def test_find_submit_branch_missing(self):
271
273
        source_branch = self.make_branch('source')
317
319
        source_branch = self.make_branch('source')
318
320
        public_branch = self.make_branch('public')
319
321
        source_branch.set_public_branch(public_branch.base)
320
 
        source_branch.set_submit_branch('http://example.com/submit')
 
322
        submit_transport = self.get_transport().clone('submit')
 
323
        submit_transport.ensure_base()
 
324
        source_branch.set_submit_branch(submit_transport.base)
321
325
        config = source_branch.get_config()
322
326
        config.set_user_option('pqm_email', 'PQM <pqm@example.com>')
323
327
        config.set_user_option(
351
355
 
352
356
        public_branch = self.make_branch('public')
353
357
        source_tree.branch.set_public_branch(public_branch.base)
354
 
        source_tree.branch.set_submit_branch('http://example.com/submit')
 
358
        submit_transport = self.get_transport().clone('submit')
 
359
        submit_transport.ensure_base()
 
360
        source_tree.branch.set_submit_branch(submit_transport.base)
355
361
        config = source_tree.branch.get_config()
356
362
        config.set_user_option('pqm_email', 'PQM <pqm@example.com>')
357
363
        config.set_user_option(
362
368
                                   './source'],
363
369
                                  retcode=3)
364
370
        self.assertContainsRe(err,
365
 
            r'Working tree ".*/source/" has uncommitted changes\.')
 
371
            r'Working tree ".*/source/" has uncommitted changes')
366
372
 
367
373
    def test_submit_subdir_of_branch(self):
368
374
        source_branch = self.make_branch('source')
388
394
        (out, err, connect_calls,
389
395
         sendmail_calls) = self.run_bzr_fakemail(
390
396
                ['pqm-submit', '-m', 'commit message',
391
 
                 '--submit-branch', 'http://example.com/submit',
 
397
                 '--submit-branch', 'http://example.com/submit/',
392
398
                 './source'
393
399
                ])
394
400
        self.assertEqual('', out)