844
844
branch = self.make_remote_branch(transport, client)
845
845
result = branch.get_parent()
846
846
self.assertEqual('http://foo/', result)
847
client.finished_test()
850
class TestBranchSetParentLocation(RemoteBranchTestCase):
852
def test_no_parent(self):
853
# We call the verb when setting parent to None
854
transport = MemoryTransport()
855
client = FakeClient(transport.base)
856
client.add_expected_call(
857
'Branch.get_stacked_on_url', ('quack/',),
858
'error', ('NotStacked',))
859
client.add_expected_call(
860
'Branch.set_parent_location', ('quack/', 'b', 'r', ''),
862
transport.mkdir('quack')
863
transport = transport.clone('quack')
864
branch = self.make_remote_branch(transport, client)
865
branch._lock_token = 'b'
866
branch._repo_lock_token = 'r'
867
branch._set_parent_location(None)
868
client.finished_test()
870
def test_parent(self):
871
transport = MemoryTransport()
872
client = FakeClient(transport.base)
873
client.add_expected_call(
874
'Branch.get_stacked_on_url', ('kwaak/',),
875
'error', ('NotStacked',))
876
client.add_expected_call(
877
'Branch.set_parent_location', ('kwaak/', 'b', 'r', 'foo'),
879
transport.mkdir('kwaak')
880
transport = transport.clone('kwaak')
881
branch = self.make_remote_branch(transport, client)
882
branch._lock_token = 'b'
883
branch._repo_lock_token = 'r'
884
branch._set_parent_location('foo')
885
client.finished_test()
887
def test_backwards_compat(self):
888
self.setup_smart_server_with_call_log()
889
branch = self.make_branch('.')
890
self.reset_smart_call_log()
891
verb = 'Branch.set_parent_location'
892
self.disable_verb(verb)
893
branch.set_parent('http://foo/')
894
self.assertLength(12, self.hpss_calls)
849
897
class TestBranchGetTagsBytes(RemoteBranchTestCase):