/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/blackbox/test_selftest.py

  • Committer: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import os
20
20
 
21
 
from breezy import (
 
21
from bzrlib import (
22
22
    tests,
23
23
    )
24
 
from breezy.tests import (
 
24
from bzrlib.tests import (
25
25
    features,
26
26
    )
27
 
from breezy.transport import memory
 
27
from bzrlib.transport import memory
28
28
 
29
29
class SelfTestPatch:
30
30
 
57
57
        # Test that we can pass a transport to the selftest core - sftp
58
58
        # version.
59
59
        self.requireFeature(features.paramiko)
60
 
        from breezy.tests import stub_sftp
 
60
        from bzrlib.tests import stub_sftp
61
61
        params = self.get_params_passed_to_core('selftest --transport=sftp')
62
62
        self.assertEqual(stub_sftp.SFTPAbsoluteServer,
63
63
            params[1]["transport"])
89
89
            'selftest --starting-with foo --starting-with bar')
90
90
        self.assertEqual(['foo', 'bar'], params[1]['starting_with'])
91
91
 
92
 
    def test_subunitv1(self):
93
 
        self.requireFeature(features.subunit)
94
 
        params = self.get_params_passed_to_core('selftest --subunit1')
95
 
        self.assertEqual(tests.SubUnitBzrRunnerv1, params[1]['runner_class'])
96
 
 
97
 
    def test_subunitv2(self):
98
 
        self.requireFeature(features.subunit)
99
 
        params = self.get_params_passed_to_core('selftest --subunit2')
100
 
        self.assertEqual(tests.SubUnitBzrRunnerv2, params[1]['runner_class'])
 
92
    def test_subunit(self):
 
93
        self.requireFeature(features.subunit)
 
94
        params = self.get_params_passed_to_core('selftest --subunit')
 
95
        self.assertEqual(tests.SubUnitBzrRunner, params[1]['runner_class'])
101
96
 
102
97
    def _parse_test_list(self, lines, newlines_in_header=0):
103
98
        "Parse a list of lines into a tuple of 3 lists (header,body,footer)."
125
120
        # If the last body line is blank, drop it off the list
126
121
        if len(body) > 0 and body[-1] == '':
127
122
            body.pop()
128
 
        return (header, body, footer)
 
123
        return (header,body,footer)
129
124
 
130
125
    def test_list_only(self):
131
 
        # check that brz selftest --list-only outputs no ui noise
 
126
        # check that bzr selftest --list-only outputs no ui noise
132
127
        def selftest(*args, **kwargs):
133
128
            """Capture the arguments selftest was run with."""
134
129
            return True
135
130
        def outputs_nothing(cmdline):
136
 
            out, err = self.run_bzr(cmdline)
137
 
            (header, body, footer) = self._parse_test_list(out.splitlines())
 
131
            out,err = self.run_bzr(cmdline)
 
132
            (header,body,footer) = self._parse_test_list(out.splitlines())
138
133
            num_tests = len(body)
139
134
            self.assertLength(0, header)
140
135
            self.assertLength(0, footer)