/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 breezy/tests/blackbox/test_reference.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-03-25 11:54:30 UTC
  • mfrom: (6855.4.10 more-bees)
  • Revision ID: breezy.the.bot@gmail.com-20180325115430-75xnlbrmzjoomd83
Add more bees. In particular:

* for file ids
* for revision ids
* for file contents in build_tree_contents()

Merged from https://code.launchpad.net/~jelmer/brz/more-bees/+merge/337919

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
 
from bzrlib import (
19
 
    branch as _mod_branch,
20
 
    bzrdir,
21
 
    )
22
 
from bzrlib.tests import TestCaseWithTransport
 
18
from breezy import (
 
19
    controldir,
 
20
    )
 
21
from breezy.bzr import (
 
22
    branch as _mod_bzrbranch,
 
23
    )
 
24
from breezy.tests import TestCaseWithTransport
23
25
 
24
26
 
25
27
class TestReference(TestCaseWithTransport):
26
28
 
27
 
    def make_branch(self, location, format=None):
28
 
        if format is None:
29
 
            format = bzrdir.format_registry.make_bzrdir('1.9')
30
 
            format.set_branch_format(_mod_branch.BzrBranchFormat8())
31
 
        return TestCaseWithTransport.make_branch(self, location, format=format)
 
29
    def get_default_format(self):
 
30
        format = controldir.format_registry.make_controldir('1.9')
 
31
        format.set_branch_format(_mod_bzrbranch.BzrBranchFormat8())
 
32
        return format
32
33
 
33
34
    def test_no_args_lists(self):
34
35
        branch = self.make_branch('branch')
42
43
    def make_tree_with_reference(self):
43
44
        tree = self.make_branch_and_tree('tree')
44
45
        self.build_tree(['tree/newpath'])
45
 
        tree.add('newpath', 'file-id')
 
46
        tree.add('newpath', b'file-id')
46
47
        tree.branch.set_reference_info('file-id', 'path', 'http://example.org')
47
48
        tree.branch.set_reference_info('file-id2', 'lath',
48
49
                                       'http://example.org/2')
56
57
    def test_uses_basis_tree_location(self):
57
58
        tree = self.make_tree_with_reference()
58
59
        tree.commit('add newpath')
59
 
        tree.bzrdir.destroy_workingtree()
 
60
        tree.controldir.destroy_workingtree()
60
61
        out, err = self.run_bzr('reference', working_dir='tree')
61
62
        self.assertContainsRe(out, 'newpath http://example.org\n')
62
63
 
73
74
    def test_two_args_sets(self):
74
75
        tree = self.make_branch_and_tree('tree')
75
76
        self.build_tree(['tree/file'])
76
 
        tree.add('file', 'file-id')
 
77
        tree.add('file', b'file-id')
77
78
        out, err = self.run_bzr('reference tree/file http://example.org')
78
79
        path, location = tree.branch.get_reference_info('file-id')
79
80
        self.assertEqual('http://example.org', location)
85
86
        tree = self.make_branch_and_tree('tree')
86
87
        out, err = self.run_bzr('reference file http://example.org',
87
88
                                working_dir='tree', retcode=3)
88
 
        self.assertEqual('bzr: ERROR: file is not versioned.\n', err)
 
89
        self.assertEqual('brz: ERROR: file is not versioned.\n', err)