512
512
self.assertFinished(client)
515
class TestBzrDirHasWorkingTree(TestRemote):
517
def test_has_workingtree(self):
518
transport = self.get_transport('quack')
519
client = FakeClient(transport.base)
520
client.add_expected_call(
521
'BzrDir.has_workingtree', ('quack/',),
522
'success', ('yes',)),
523
a_bzrdir = RemoteBzrDir(transport, RemoteBzrDirFormat(),
525
self.assertTrue(a_bzrdir.has_workingtree())
526
self.assertFinished(client)
528
def test_no_workingtree(self):
529
transport = self.get_transport('quack')
530
client = FakeClient(transport.base)
531
client.add_expected_call(
532
'BzrDir.has_workingtree', ('quack/',),
534
a_bzrdir = RemoteBzrDir(transport, RemoteBzrDirFormat(),
536
self.assertFalse(a_bzrdir.has_workingtree())
537
self.assertFinished(client)
540
class TestBzrDirDestroyRepository(TestRemote):
542
def test_destroy_repository(self):
543
transport = self.get_transport('quack')
544
client = FakeClient(transport.base)
545
client.add_expected_call(
546
'BzrDir.destroy_repository', ('quack/',),
548
a_bzrdir = RemoteBzrDir(transport, RemoteBzrDirFormat(),
550
a_bzrdir.destroy_repository()
551
self.assertFinished(client)
515
554
class TestBzrDirOpen(TestRemote):
517
556
def make_fake_client_and_transport(self, path='quack'):
2506
2545
call.call.method == verb])
2548
class TestRepositoryHasSignatureForRevisionId(TestRemoteRepository):
2550
def test_has_signature_for_revision_id(self):
2551
# ('yes', ) for Repository.has_signature_for_revision_id -> 'True'.
2552
transport_path = 'quack'
2553
repo, client = self.setup_fake_client_and_repository(transport_path)
2554
client.add_success_response('yes')
2555
result = repo.has_signature_for_revision_id('A')
2557
[('call', 'Repository.has_signature_for_revision_id',
2560
self.assertEqual(True, result)
2562
def test_is_not_shared(self):
2563
# ('no', ) for Repository.has_signature_for_revision_id -> 'False'.
2564
transport_path = 'qwack'
2565
repo, client = self.setup_fake_client_and_repository(transport_path)
2566
client.add_success_response('no')
2567
result = repo.has_signature_for_revision_id('A')
2569
[('call', 'Repository.has_signature_for_revision_id',
2572
self.assertEqual(False, result)
2509
2575
class TestRepositoryIsShared(TestRemoteRepository):
2511
2577
def test_is_shared(self):
2531
2597
self.assertEqual(False, result)
2600
class TestRepositoryMakeWorkingTrees(TestRemoteRepository):
2602
def test_make_working_trees(self):
2603
# ('yes', ) for Repository.make_working_trees -> 'True'.
2604
transport_path = 'quack'
2605
repo, client = self.setup_fake_client_and_repository(transport_path)
2606
client.add_success_response('yes')
2607
result = repo.make_working_trees()
2609
[('call', 'Repository.make_working_trees', ('quack/',))],
2611
self.assertEqual(True, result)
2613
def test_no_working_trees(self):
2614
# ('no', ) for Repository.make_working_trees -> 'False'.
2615
transport_path = 'qwack'
2616
repo, client = self.setup_fake_client_and_repository(transport_path)
2617
client.add_success_response('no')
2618
result = repo.make_working_trees()
2620
[('call', 'Repository.make_working_trees', ('qwack/',))],
2622
self.assertEqual(False, result)
2534
2625
class TestRepositoryLockWrite(TestRemoteRepository):
2536
2627
def test_lock_write(self):