~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testbranch.py

Merged Martin

Show diffs side-by-side

added added

removed removed

Lines of Context:
352
352
        self.failUnless(isinstance(self.branch._transaction,
353
353
                                   transactions.PassThroughTransaction))
354
354
        self.branch.unlock()
 
355
 
 
356
 
 
357
class TestBranchPushLocations(TestCaseInTempDir):
 
358
 
 
359
    def setUp(self):
 
360
        super(TestBranchPushLocations, self).setUp()
 
361
        self.branch = Branch.initialize('.')
 
362
        
 
363
    def test_get_push_location_unset(self):
 
364
        self.assertEqual(None, self.branch.get_push_location())
 
365
 
 
366
    def test_get_push_location_exact(self):
 
367
        self.build_tree(['.bazaar/'])
 
368
        print >> open('.bazaar/branches.conf', 'wt'), ("[%s]\n"
 
369
                                                       "push_location=foo" %
 
370
                                                       os.getcwdu())
 
371
        self.assertEqual("foo", self.branch.get_push_location())
 
372
 
 
373
    def test_set_push_location(self):
 
374
        self.branch.set_push_location('foo')
 
375
        self.assertFileEqual("[%s]\n"
 
376
                             "push_location = foo" % os.getcwdu(),
 
377
                             '.bazaar/branches.conf')
 
378
 
 
379
    # TODO RBC 20051029 test getting a push location from a branch in a 
 
380
    # recursive section - that is, it appends the branch name.