/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart.py

  • Committer: Robert Collins
  • Date: 2009-03-05 05:26:24 UTC
  • mto: (4083.1.3 robert-rollup)
  • mto: This revision was merged to the branch mainline in revision 4084.
  • Revision ID: robertc@robertcollins.net-20090305052624-ejso9br8bxv68twx
Add a Branch.get_parent remote call for RemoteBranch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
658
658
        self.assertEqual('child-1', self.tree.branch.last_revision())
659
659
 
660
660
 
 
661
class TestSmartServerBranchRequestGetParent(tests.TestCaseWithMemoryTransport):
 
662
 
 
663
    def test_get_parent_none(self):
 
664
        base_branch = self.make_branch('base')
 
665
        request = smart.branch.SmartServerBranchGetParent(self.get_transport())
 
666
        response = request.execute('base')
 
667
        self.assertEquals(
 
668
            SuccessfulSmartServerResponse(('')), response)
 
669
 
 
670
    def test_get_parent_something(self):
 
671
        base_branch = self.make_branch('base')
 
672
        base_branch.set_parent(self.get_url('foo'))
 
673
        request = smart.branch.SmartServerBranchGetParent(self.get_transport())
 
674
        response = request.execute('base')
 
675
        self.assertEquals(
 
676
            SuccessfulSmartServerResponse(("../foo")),
 
677
            response)
 
678
 
 
679
 
661
680
class TestSmartServerBranchRequestGetStackedOnURL(tests.TestCaseWithMemoryTransport):
662
681
 
663
682
    def test_get_stacked_on_url(self):
1168
1187
            smart.request.request_handlers.get('Branch.get_config_file'),
1169
1188
            smart.branch.SmartServerBranchGetConfigFile)
1170
1189
        self.assertEqual(
 
1190
            smart.request.request_handlers.get('Branch.get_parent'),
 
1191
            smart.branch.SmartServerBranchGetParent)
 
1192
        self.assertEqual(
1171
1193
            smart.request.request_handlers.get('Branch.lock_write'),
1172
1194
            smart.branch.SmartServerBranchRequestLockWrite)
1173
1195
        self.assertEqual(