795
class TestSmartServerBranchRequestSetParent(tests.TestCaseWithMemoryTransport):
797
def test_set_parent_none(self):
798
branch = self.make_branch('base', format="1.9")
800
branch._set_parent_location('foo')
802
request = smart.branch.SmartServerBranchRequestSetParentLocation(
803
self.get_transport())
804
branch_token = branch.lock_write()
805
repo_token = branch.repository.lock_write()
807
response = request.execute('base', branch_token, repo_token, '')
809
branch.repository.unlock()
811
self.assertEqual(SuccessfulSmartServerResponse(()), response)
812
self.assertEqual(None, branch.get_parent())
814
def test_set_parent_something(self):
815
branch = self.make_branch('base', format="1.9")
816
request = smart.branch.SmartServerBranchRequestSetParentLocation(
817
self.get_transport())
818
branch_token = branch.lock_write()
819
repo_token = branch.repository.lock_write()
821
response = request.execute('base', branch_token, repo_token,
824
branch.repository.unlock()
826
self.assertEqual(SuccessfulSmartServerResponse(()), response)
827
self.assertEqual('http://bar/', branch.get_parent())
795
830
class TestSmartServerBranchRequestGetTagsBytes(tests.TestCaseWithMemoryTransport):
796
831
# Only called when the branch format and tags match [yay factory
797
832
# methods] so only need to test straight forward cases.
1432
1467
smart.branch.SmartServerBranchRequestSetLastRevision)
1433
1468
self.assertHandlerEqual('Branch.set_last_revision_info',
1434
1469
smart.branch.SmartServerBranchRequestSetLastRevisionInfo)
1470
self.assertHandlerEqual('Branch.set_last_revision_ex',
1471
smart.branch.SmartServerBranchRequestSetLastRevisionEx)
1472
self.assertHandlerEqual('Branch.set_parent_location',
1473
smart.branch.SmartServerBranchRequestSetParentLocation)
1435
1474
self.assertHandlerEqual('Branch.unlock',
1436
1475
smart.branch.SmartServerBranchRequestUnlock)
1437
1476
self.assertHandlerEqual('BzrDir.find_repository',