~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_branch.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from bzrlib import (
28
28
    branch as _mod_branch,
29
29
    bzrdir,
 
30
    config,
30
31
    errors,
 
32
    trace,
31
33
    urlutils,
32
34
    )
33
35
from bzrlib.branch import (
281
283
    def test_light_checkout_with_references(self):
282
284
        self.do_checkout_test(lightweight=True)
283
285
 
 
286
    def test_set_push(self):
 
287
        branch = self.make_branch('source', format='dirstate-tags')
 
288
        branch.get_config().set_user_option('push_location', 'old',
 
289
            store=config.STORE_LOCATION)
 
290
        warnings = []
 
291
        def warning(*args):
 
292
            warnings.append(args[0] % args[1:])
 
293
        _warning = trace.warning
 
294
        trace.warning = warning
 
295
        try:
 
296
            branch.set_push_location('new')
 
297
        finally:
 
298
            trace.warning = _warning
 
299
        self.assertEqual(warnings[0], 'Value "new" is masked by "old" from '
 
300
                         'locations.conf')
 
301
 
284
302
class TestBranchReference(TestCaseWithTransport):
285
303
    """Tests for the branch reference facility."""
286
304