/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/branch_implementations/test_branch.py

  • Committer: Jelmer Vernooij
  • Date: 2009-02-25 22:13:56 UTC
  • mfrom: (4048 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4053.
  • Revision ID: jelmer@samba.org-20090225221356-mybvo95xatofd4t3
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
493
493
        self.assertEquals(br.revision_history(), [])
494
494
 
495
495
 
 
496
class TestBranchFormat(TestCaseWithBranch):
 
497
 
 
498
    def test_branch_format_network_name(self):
 
499
        br = self.make_branch('.')
 
500
        format = br._format
 
501
        network_name = format.network_name()
 
502
        self.assertIsInstance(network_name, str)
 
503
        # We want to test that the network_name matches the actual format on
 
504
        # disk. For local branches that means that using network_name as a key
 
505
        # in the registry gives back the same format. For remote branches we
 
506
        # check that the network_name of the RemoteBranchFormat we have locally
 
507
        # matches the actual format present on disk.
 
508
        if isinstance(format, remote.RemoteBranchFormat):
 
509
            br._ensure_real()
 
510
            real_branch = br._real_branch
 
511
            self.assertEqual(real_branch._format.network_name(), network_name)
 
512
        else:
 
513
            registry = branch.network_format_registry
 
514
            looked_up_format = registry.get(network_name)
 
515
            self.assertEqual(format.__class__, looked_up_format.__class__)
 
516
 
 
517
 
496
518
class ChrootedTests(TestCaseWithBranch):
497
519
    """A support class that provides readonly urls outside the local namespace.
498
520