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

  • Committer: Jelmer Vernooij
  • Date: 2017-07-23 22:06:41 UTC
  • mfrom: (6738 trunk)
  • mto: This revision was merged to the branch mainline in revision 6739.
  • Revision ID: jelmer@jelmer.uk-20170723220641-69eczax9bmv8d6kk
Merge trunk, address review comments.

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
 
18
19
"""Tests of the 'brz bisect' command."""
19
20
 
 
21
from __future__ import absolute_import
 
22
 
20
23
import os
21
24
import shutil
22
25
import stat
26
29
from .. import (
27
30
    KnownFailure,
28
31
    TestCaseWithTransport,
29
 
    TestSkipped,
30
32
    )
31
 
from ...controldir import ControlDir
 
33
from ...bzr.bzrdir import BzrDir
32
34
 
33
35
 
34
36
class BisectTestCase(TestCaseWithTransport):
70
72
        test_file_append.close()
71
73
        self.tree.add(self.tree.relpath(os.path.join(os.getcwd(),
72
74
                                                     'test_file_append')))
73
 
        self.tree.commit(message="add test files")
 
75
        self.tree.commit(message = "add test files")
74
76
 
75
 
        ControlDir.open(".").sprout("../temp-clone")
76
 
        clone_controldir = ControlDir.open("../temp-clone")
77
 
        clone_tree = clone_controldir.open_workingtree()
 
77
        BzrDir.open(".").sprout("../temp-clone")
 
78
        clone_bzrdir = BzrDir.open("../temp-clone")
 
79
        clone_tree = clone_bzrdir.open_workingtree()
78
80
        for content in ["one dot one", "one dot two", "one dot three"]:
79
81
            test_file = open("../temp-clone/test_file", "w")
80
82
            test_file.write(content)
82
84
            test_file_append = open("../temp-clone/test_file_append", "a")
83
85
            test_file_append.write(content + "\n")
84
86
            test_file_append.close()
85
 
            clone_tree.commit(message="make branch test change")
 
87
            clone_tree.commit(message = "make branch test change")
86
88
            saved_subtree_revid = clone_tree.branch.last_revision()
87
89
 
88
90
        self.tree.merge_from_branch(clone_tree.branch)
92
94
        test_file_append = open("test_file_append", "a")
93
95
        test_file_append.write("two\n")
94
96
        test_file_append.close()
95
 
        self.tree.commit(message="merge external branch")
 
97
        self.tree.commit(message = "merge external branch")
96
98
        shutil.rmtree("../temp-clone")
97
99
 
98
100
        self.subtree_rev = saved_subtree_revid
105
107
            test_file_append = open("test_file_append", "a")
106
108
            test_file_append.write(content + "\n")
107
109
            test_file_append.close()
108
 
            self.tree.commit(message="make test change")
 
110
            self.tree.commit(message = "make test change")
109
111
 
110
112
    def testWorkflow(self):
111
113
        """Run through a basic usage scenario."""
275
277
        try:
276
278
            self.assertRevno(2)
277
279
        except AssertionError:
278
 
            raise KnownFailure("bisect does not drill down into merge commits: "
279
 
                               "https://bugs.launchpad.net/bzr-bisect/+bug/539937")
 
280
            raise KnownFailure\
 
281
                ("bisect does not drill down into merge commits: "
 
282
                 "https://bugs.launchpad.net/bzr-bisect/+bug/539937")
280
283
 
281
284
    def testRunScriptSubtree(self):
282
285
        """Make a test script and run it."""
294
297
        try:
295
298
            self.assertRevno(1.2)
296
299
        except AssertionError:
297
 
            raise KnownFailure("bisect does not drill down into merge commits: "
298
 
                               "https://bugs.launchpad.net/bzr-bisect/+bug/539937")
 
300
            raise KnownFailure\
 
301
                ("bisect does not drill down into merge commits: "
 
302
                 "https://bugs.launchpad.net/bzr-bisect/+bug/539937")