~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testbranch.py

[merge] robert

Show diffs side-by-side

added added

removed removed

Lines of Context:
334
334
        self.failUnless(isinstance(self.branch._transaction,
335
335
                                   transactions.PassThroughTransaction))
336
336
        self.branch.unlock()
 
337
 
 
338
 
 
339
class TestBranchPushLocations(TestCaseInTempDir):
 
340
 
 
341
    def setUp(self):
 
342
        super(TestBranchPushLocations, self).setUp()
 
343
        self.branch = Branch.initialize('.')
 
344
        
 
345
    def test_get_push_location_unset(self):
 
346
        self.assertEqual(None, self.branch.get_push_location())
 
347
 
 
348
    def test_get_push_location_exact(self):
 
349
        self.build_tree(['.bazaar/'])
 
350
        print >> open('.bazaar/branches.conf', 'wt'), ("[%s]\n"
 
351
                                                       "push_location=foo" %
 
352
                                                       os.getcwdu())
 
353
        self.assertEqual("foo", self.branch.get_push_location())
 
354
 
 
355
    def test_set_push_location(self):
 
356
        self.branch.set_push_location('foo')
 
357
        self.assertFileEqual("[%s]\n"
 
358
                             "push_location = foo" % os.getcwdu(),
 
359
                             '.bazaar/branches.conf')
 
360
 
 
361
    # TODO RBC 20051029 test getting a push location from a branch in a 
 
362
    # recursive section - that is, it appends the branch name.