/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 14:36:59 UTC
  • mfrom: (4048 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4049.
  • Revision ID: jelmer@samba.org-20090225143659-vx6cbqtmyicuzfyf
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
        self.assertIs(self.branch_format.__class__,
59
59
                      bzrdir_branch_format.__class__)
60
60
 
 
61
    def test_make_branch_gets_expected_format(self):
 
62
        branch = self.make_branch('.')
 
63
        self.assertIs(self.branch_format.__class__,
 
64
            branch._format.__class__)
 
65
 
61
66
 
62
67
class TestBranch(TestCaseWithBranch):
63
68
 
207
212
        self.assertEqual(branch.get_submit_branch(), 'sftp://example.com')
208
213
        branch.set_submit_branch('sftp://example.net')
209
214
        self.assertEqual(branch.get_submit_branch(), 'sftp://example.net')
210
 
        
 
215
 
211
216
    def test_public_branch(self):
212
217
        """public location can be queried and set"""
213
218
        branch = self.make_branch('branch')
253
258
                          None)
254
259
 
255
260
# TODO 20051003 RBC:
256
 
# compare the gpg-to-sign info for a commit with a ghost and 
 
261
# compare the gpg-to-sign info for a commit with a ghost and
257
262
#     an identical tree without a ghost
258
263
# fetch missing should rewrite the TOC of weaves to list newly available parents.
259
 
        
 
264
 
260
265
    def test_sign_existing_revision(self):
261
266
        wt = self.make_branch_and_tree('.')
262
267
        branch = wt.branch
347
352
 
348
353
    def test_nicks(self):
349
354
        """Test explicit and implicit branch nicknames.
350
 
        
 
355
 
351
356
        Nicknames are implicitly the name of the branch's directory, unless an
352
357
        explicit nickname is set.  That is, an explicit nickname always
353
358
        overrides the implicit one.
488
493
        self.assertEquals(br.revision_history(), [])
489
494
 
490
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
 
491
518
class ChrootedTests(TestCaseWithBranch):
492
519
    """A support class that provides readonly urls outside the local namespace.
493
520