/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_remote.py

merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
512
512
        self.assertFinished(client)
513
513
 
514
514
 
 
515
class TestBzrDirHasWorkingTree(TestRemote):
 
516
 
 
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(),
 
524
            _client=client)
 
525
        self.assertTrue(a_bzrdir.has_workingtree())
 
526
        self.assertFinished(client)
 
527
 
 
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/',),
 
533
            'success', ('no',)),
 
534
        a_bzrdir = RemoteBzrDir(transport, RemoteBzrDirFormat(),
 
535
            _client=client)
 
536
        self.assertFalse(a_bzrdir.has_workingtree())
 
537
        self.assertFinished(client)
 
538
 
 
539
 
 
540
class TestBzrDirDestroyRepository(TestRemote):
 
541
 
 
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/',),
 
547
            'success', ('ok',)),
 
548
        a_bzrdir = RemoteBzrDir(transport, RemoteBzrDirFormat(),
 
549
            _client=client)
 
550
        a_bzrdir.destroy_repository()
 
551
        self.assertFinished(client)
 
552
 
 
553
 
515
554
class TestBzrDirOpen(TestRemote):
516
555
 
517
556
    def make_fake_client_and_transport(self, path='quack'):
2506
2545
                              call.call.method == verb])
2507
2546
 
2508
2547
 
 
2548
class TestRepositoryHasSignatureForRevisionId(TestRemoteRepository):
 
2549
 
 
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')
 
2556
        self.assertEqual(
 
2557
            [('call', 'Repository.has_signature_for_revision_id',
 
2558
              ('quack/', 'A'))],
 
2559
            client._calls)
 
2560
        self.assertEqual(True, result)
 
2561
 
 
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')
 
2568
        self.assertEqual(
 
2569
            [('call', 'Repository.has_signature_for_revision_id',
 
2570
              ('qwack/', 'A'))],
 
2571
            client._calls)
 
2572
        self.assertEqual(False, result)
 
2573
 
 
2574
 
2509
2575
class TestRepositoryIsShared(TestRemoteRepository):
2510
2576
 
2511
2577
    def test_is_shared(self):
2531
2597
        self.assertEqual(False, result)
2532
2598
 
2533
2599
 
 
2600
class TestRepositoryMakeWorkingTrees(TestRemoteRepository):
 
2601
 
 
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()
 
2608
        self.assertEqual(
 
2609
            [('call', 'Repository.make_working_trees', ('quack/',))],
 
2610
            client._calls)
 
2611
        self.assertEqual(True, result)
 
2612
 
 
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()
 
2619
        self.assertEqual(
 
2620
            [('call', 'Repository.make_working_trees', ('qwack/',))],
 
2621
            client._calls)
 
2622
        self.assertEqual(False, result)
 
2623
 
 
2624
 
2534
2625
class TestRepositoryLockWrite(TestRemoteRepository):
2535
2626
 
2536
2627
    def test_lock_write(self):