~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_branch.py

  • Committer: Jelmer Vernooij
  • Date: 2010-12-20 11:57:14 UTC
  • mto: This revision was merged to the branch mainline in revision 5577.
  • Revision ID: jelmer@samba.org-20101220115714-2ru3hfappjweeg7q
Don't use no-plugins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    bzrdir,
30
30
    config,
31
31
    errors,
 
32
    symbol_versioning,
32
33
    tests,
33
34
    trace,
34
35
    transport,
112
113
        """See BzrBranchFormat.get_format_string()."""
113
114
        return "Sample branch format."
114
115
 
115
 
    def initialize(self, a_bzrdir, name=None):
 
116
    def initialize(self, a_bzrdir, name=None, repository=None):
116
117
        """Format 4 branches cannot be created."""
117
118
        t = a_bzrdir.get_branch_transport(self, name=name)
118
119
        t.put_bytes('format', self.get_format_string())
266
267
    def test_config(self):
267
268
        """Ensure that all configuration data is stored in the branch"""
268
269
        branch = self.make_branch('a', format=self.get_format_name())
269
 
        branch.set_parent('http://bazaar-vcs.org')
 
270
        branch.set_parent('http://example.com')
270
271
        self.failIfExists('a/.bzr/branch/parent')
271
 
        self.assertEqual('http://bazaar-vcs.org', branch.get_parent())
272
 
        branch.set_push_location('sftp://bazaar-vcs.org')
 
272
        self.assertEqual('http://example.com', branch.get_parent())
 
273
        branch.set_push_location('sftp://example.com')
273
274
        config = branch.get_config()._get_branch_data_config()
274
 
        self.assertEqual('sftp://bazaar-vcs.org',
 
275
        self.assertEqual('sftp://example.com',
275
276
                         config.get_user_option('push_location'))
276
 
        branch.set_bound_location('ftp://bazaar-vcs.org')
 
277
        branch.set_bound_location('ftp://example.com')
277
278
        self.failIfExists('a/.bzr/branch/bound')
278
 
        self.assertEqual('ftp://bazaar-vcs.org', branch.get_bound_location())
 
279
        self.assertEqual('ftp://example.com', branch.get_bound_location())
279
280
 
280
281
    def test_set_revision_history(self):
281
282
        builder = self.make_branch_builder('.', format=self.get_format_name())
622
623
        # this usage of results is not recommended for new code (because it
623
624
        # doesn't describe very well what happened), but for api stability
624
625
        # it's still supported
625
 
        a = "%d revisions pulled" % r
626
 
        self.assertEqual(a, "10 revisions pulled")
 
626
        self.assertEqual(self.applyDeprecated(
 
627
            symbol_versioning.deprecated_in((2, 3, 0)),
 
628
            r.__int__),
 
629
            10)
627
630
 
628
631
    def test_report_changed(self):
629
632
        r = _mod_branch.PullResult()