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

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 19:09:26 UTC
  • mfrom: (6622.1.36 breezy)
  • Revision ID: jelmer@jelmer.uk-20170521190926-5vtz8xaf0e9ylrpc
Merge rename to breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
# NOTE: Some classes in here use camelCaseNaming() rather than
22
22
# underscore_naming().  That's for consistency with unittest; it's not the
23
 
# general style of bzrlib.  Please continue that consistency when adding e.g.
 
23
# general style of breezy.  Please continue that consistency when adding e.g.
24
24
# new assertFoo() methods.
25
25
 
26
26
import atexit
58
58
        % (testtools.__file__, _testtools_version))
59
59
from testtools import content
60
60
 
61
 
import bzrlib
62
 
from bzrlib import (
 
61
import breezy
 
62
from breezy import (
63
63
    branchbuilder,
64
64
    controldir,
65
65
    chk_map,
84
84
    workingtree,
85
85
    )
86
86
try:
87
 
    import bzrlib.lsprof
 
87
    import breezy.lsprof
88
88
except ImportError:
89
89
    # lsprof not available
90
90
    pass
91
 
from bzrlib.smart import client, request
92
 
from bzrlib.transport import (
 
91
from breezy.smart import client, request
 
92
from breezy.transport import (
93
93
    memory,
94
94
    pathfilter,
95
95
    )
96
 
from bzrlib.symbol_versioning import (
 
96
from breezy.symbol_versioning import (
97
97
    deprecated_function,
98
98
    deprecated_in,
99
99
    )
100
 
from bzrlib.tests import (
 
100
from breezy.tests import (
101
101
    fixtures,
102
102
    test_server,
103
103
    TestUtil,
104
104
    treeshape,
105
105
    )
106
 
from bzrlib.ui import NullProgressView
107
 
from bzrlib.ui.text import TextUIFactory
108
 
from bzrlib.tests.features import _CompatabilityThunkFeature
 
106
from breezy.ui import NullProgressView
 
107
from breezy.ui.text import TextUIFactory
 
108
from breezy.tests.features import _CompatabilityThunkFeature
109
109
 
110
110
# Mark this python module as being part of the implementation
111
111
# of unittest: this gives us better tracebacks where the last
124
124
SUBUNIT_SEEK_CUR = 1
125
125
 
126
126
# These are intentionally brought into this namespace. That way plugins, etc
127
 
# can just "from bzrlib.tests import TestCase, TestLoader, etc"
 
127
# can just "from breezy.tests import TestCase, TestLoader, etc"
128
128
TestSuite = TestUtil.TestSuite
129
129
TestLoader = TestUtil.TestLoader
130
130
 
136
136
# the tests should start without this variable in the environment. There are a
137
137
# few exceptions but you shouldn't violate this rule lightly.
138
138
isolated_environ = {
139
 
    'BZR_HOME': None,
 
139
    'BRZ_HOME': None,
140
140
    'HOME': None,
141
141
    'XDG_CONFIG_HOME': None,
142
 
    # bzr now uses the Win32 API and doesn't rely on APPDATA, but the
 
142
    # brz now uses the Win32 API and doesn't rely on APPDATA, but the
143
143
    # tests do check our impls match APPDATA
144
 
    'BZR_EDITOR': None, # test_msgeditor manipulates this variable
 
144
    'BRZ_EDITOR': None, # test_msgeditor manipulates this variable
145
145
    'VISUAL': None,
146
146
    'EDITOR': None,
147
 
    'BZR_EMAIL': None,
 
147
    'BRZ_EMAIL': None,
148
148
    'BZREMAIL': None, # may still be present in the environment
149
 
    'EMAIL': 'jrandom@example.com', # set EMAIL as bzr does not guess
150
 
    'BZR_PROGRESS_BAR': None,
151
 
    # This should trap leaks to ~/.bzr.log. This occurs when tests use TestCase
 
149
    'EMAIL': 'jrandom@example.com', # set EMAIL as brz does not guess
 
150
    'BRZ_PROGRESS_BAR': None,
 
151
    # This should trap leaks to ~/.brz.log. This occurs when tests use TestCase
152
152
    # as a base class instead of TestCaseInTempDir. Tests inheriting from
153
 
    # TestCase should not use disk resources, BZR_LOG is one.
154
 
    'BZR_LOG': '/you-should-use-TestCaseInTempDir-if-you-need-a-log-file',
155
 
    'BZR_PLUGIN_PATH': None,
156
 
    'BZR_DISABLE_PLUGINS': None,
157
 
    'BZR_PLUGINS_AT': None,
158
 
    'BZR_CONCURRENCY': None,
 
153
    # TestCase should not use disk resources, BRZ_LOG is one.
 
154
    'BRZ_LOG': '/you-should-use-TestCaseInTempDir-if-you-need-a-log-file',
 
155
    'BRZ_PLUGIN_PATH': None,
 
156
    'BRZ_DISABLE_PLUGINS': None,
 
157
    'BRZ_PLUGINS_AT': None,
 
158
    'BRZ_CONCURRENCY': None,
159
159
    # Make sure that any text ui tests are consistent regardless of
160
160
    # the environment the test case is run in; you may want tests that
161
161
    # test other combinations.  'dumb' is a reasonable guess for tests
163
163
    'TERM': 'dumb',
164
164
    'LINES': '25',
165
165
    'COLUMNS': '80',
166
 
    'BZR_COLUMNS': '80',
 
166
    'BRZ_COLUMNS': '80',
167
167
    # Disable SSH Agent
168
168
    'SSH_AUTH_SOCK': None,
169
169
    # Proxies
269
269
        """
270
270
        testtools.TextTestResult.__init__(self, stream)
271
271
        if bench_history is not None:
272
 
            from bzrlib.version import _get_bzr_source_tree
 
272
            from breezy.version import _get_bzr_source_tree
273
273
            src_tree = _get_bzr_source_tree()
274
274
            if src_tree:
275
275
                try:
389
389
 
390
390
    def _shortened_test_description(self, test):
391
391
        what = test.id()
392
 
        what = re.sub(r'^bzrlib\.tests\.', '', what)
 
392
        what = re.sub(r'^breezy\.tests\.', '', what)
393
393
        return what
394
394
 
395
395
    # GZ 2010-10-04: Cloned tests may end up harmlessly calling this method
412
412
        addOnException = getattr(test, "addOnException", None)
413
413
        if addOnException is not None:
414
414
            addOnException(self._record_traceback_from_test)
415
 
        # Only check for thread leaks on bzrlib derived test cases
 
415
        # Only check for thread leaks on breezy derived test cases
416
416
        if isinstance(test, TestCase):
417
417
            test.addCleanup(self._check_leaked_threads, test)
418
418
 
535
535
 
536
536
    def _post_mortem(self, tb=None):
537
537
        """Start a PDB post mortem session."""
538
 
        if os.environ.get('BZR_TEST_PDB', None):
 
538
        if os.environ.get('BRZ_TEST_PDB', None):
539
539
            import pdb
540
540
            pdb.post_mortem(tb)
541
541
 
555
555
        else:
556
556
            bzr_path = sys.executable
557
557
        self.stream.write(
558
 
            'bzr selftest: %s\n' % (bzr_path,))
 
558
            'brz selftest: %s\n' % (bzr_path,))
559
559
        self.stream.write(
560
560
            '   %s\n' % (
561
 
                    bzrlib.__path__[0],))
 
561
                    breezy.__path__[0],))
562
562
        self.stream.write(
563
563
            '   bzr-%s python-%s %s\n' % (
564
 
                    bzrlib.version_string,
565
 
                    bzrlib._format_version_tuple(sys.version_info),
 
564
                    breezy.version_string,
 
565
                    breezy._format_version_tuple(sys.version_info),
566
566
                    platform.platform(aliased=1),
567
567
                    ))
568
568
        self.stream.write('\n')
976
976
 
977
977
 
978
978
class TestCase(testtools.TestCase):
979
 
    """Base class for bzr unit tests.
 
979
    """Base class for brz unit tests.
980
980
 
981
981
    Tests that need access to disk resources should subclass
982
982
    TestCaseInTempDir not TestCase.
988
988
    is read into memory and removed from disk.
989
989
 
990
990
    There are also convenience functions to invoke bzr's command-line
991
 
    routine, and to build and check bzr trees.
 
991
    routine, and to build and check brz trees.
992
992
 
993
993
    In addition to the usual method of overriding tearDown(), this class also
994
994
    allows subclasses to register cleanup functions via addCleanup, which are
1011
1011
    def setUp(self):
1012
1012
        super(TestCase, self).setUp()
1013
1013
 
1014
 
        # At this point we're still accessing the config files in $BZR_HOME (as
 
1014
        # At this point we're still accessing the config files in $BRZ_HOME (as
1015
1015
        # set by the user running selftest).
1016
1016
        timeout = config.GlobalStack().get('selftest.timeout')
1017
1017
        if timeout:
1023
1023
            self.requireFeature(feature)
1024
1024
        self._cleanEnvironment()
1025
1025
 
1026
 
        if bzrlib.global_state is not None:
1027
 
            self.overrideAttr(bzrlib.global_state, 'cmdline_overrides',
 
1026
        if breezy.global_state is not None:
 
1027
            self.overrideAttr(breezy.global_state, 'cmdline_overrides',
1028
1028
                              config.CommandLineStore())
1029
1029
 
1030
1030
        self._silenceUI()
1038
1038
        # Isolate global verbosity level, to make sure it's reproducible
1039
1039
        # between tests.  We should get rid of this altogether: bug 656694. --
1040
1040
        # mbp 20101008
1041
 
        self.overrideAttr(bzrlib.trace, '_verbosity_level', 0)
 
1041
        self.overrideAttr(breezy.trace, '_verbosity_level', 0)
1042
1042
        self._log_files = set()
1043
1043
        # Each key in the ``_counters`` dict holds a value for a different
1044
1044
        # counter. When the test ends, addDetail() should be used to output the
1059
1059
    def discardDetail(self, name):
1060
1060
        """Extend the addDetail, getDetails api so we can remove a detail.
1061
1061
 
1062
 
        eg. bzr always adds the 'log' detail at startup, but we don't want to
 
1062
        eg. brz always adds the 'log' detail at startup, but we don't want to
1063
1063
        include it for skipped, xfail, etc tests.
1064
1064
 
1065
1065
        It is safe to call this for a detail that doesn't exist, in case this
1221
1221
 
1222
1222
    def permit_url(self, url):
1223
1223
        """Declare that url is an ok url to use in this test.
1224
 
        
 
1224
 
1225
1225
        Do this for memory transports, temporary test directory etc.
1226
 
        
 
1226
 
1227
1227
        Do not do this for the current working directory, /tmp, or any other
1228
1228
        preexisting non isolated url.
1229
1229
        """
1232
1232
        self._bzr_selftest_roots.append(url)
1233
1233
 
1234
1234
    def permit_source_tree_branch_repo(self):
1235
 
        """Permit the source tree bzr is running from to be opened.
 
1235
        """Permit the source tree brz is running from to be opened.
1236
1236
 
1237
 
        Some code such as bzrlib.version attempts to read from the bzr branch
1238
 
        that bzr is executing from (if any). This method permits that directory
 
1237
        Some code such as breezy.version attempts to read from the brz branch
 
1238
        that brz is executing from (if any). This method permits that directory
1239
1239
        to be used in the test suite.
1240
1240
        """
1241
1241
        path = self.get_source_path()
1244
1244
            try:
1245
1245
                workingtree.WorkingTree.open(path)
1246
1246
            except (errors.NotBranchError, errors.NoWorkingTree):
1247
 
                raise TestSkipped('Needs a working tree of bzr sources')
 
1247
                raise TestSkipped('Needs a working tree of brz sources')
1248
1248
        finally:
1249
1249
            self.enable_directory_isolation()
1250
1250
 
1282
1282
 
1283
1283
    def record_directory_isolation(self):
1284
1284
        """Gather accessed directories to permit later access.
1285
 
        
1286
 
        This is used for tests that access the branch bzr is running from.
 
1285
 
 
1286
        This is used for tests that access the branch brz is running from.
1287
1287
        """
1288
1288
        self._directory_isolation = "record"
1289
1289
 
1334
1334
        # TestCase has no safe place it can write to.
1335
1335
        self._bzr_selftest_roots = []
1336
1336
        # Currently the easiest way to be sure that nothing is going on is to
1337
 
        # hook into bzr dir opening. This leaves a small window of error for
 
1337
        # hook into brz dir opening. This leaves a small window of error for
1338
1338
        # transport tests, but they are well known, and we can improve on this
1339
1339
        # step.
1340
1340
        controldir.ControlDir.hooks.install_named_hook("pre_open",
1341
 
            self._preopen_isolate_transport, "Check bzr directories are safe.")
 
1341
            self._preopen_isolate_transport, "Check brz directories are safe.")
1342
1342
 
1343
1343
    def _ndiff_strings(self, a, b):
1344
1344
        """Return ndiff between two strings containing lines.
1743
1743
        return result
1744
1744
 
1745
1745
    def _startLogFile(self):
1746
 
        """Setup a in-memory target for bzr and testcase log messages"""
 
1746
        """Setup a in-memory target for brz and testcase log messages"""
1747
1747
        pseudo_log_file = StringIO()
1748
1748
        def _get_log_contents_for_weird_testtools_api():
1749
1749
            return [pseudo_log_file.getvalue().decode(
1847
1847
        for klass, (name, hooks) in self._preserved_hooks.items():
1848
1848
            setattr(klass, name, hooks)
1849
1849
        self._preserved_hooks.clear()
1850
 
        bzrlib.hooks._lazy_hooks = self._preserved_lazy_hooks
 
1850
        breezy.hooks._lazy_hooks = self._preserved_lazy_hooks
1851
1851
        self._preserved_lazy_hooks.clear()
1852
1852
 
1853
1853
    def knownFailure(self, reason):
1945
1945
    def time(self, callable, *args, **kwargs):
1946
1946
        """Run callable and accrue the time it takes to the benchmark time.
1947
1947
 
1948
 
        If lsprofiling is enabled (i.e. by --lsprof-time to bzr selftest) then
 
1948
        If lsprofiling is enabled (i.e. by --lsprof-time to brz selftest) then
1949
1949
        this will cause lsprofile statistics to be gathered and stored in
1950
1950
        self._benchcalls.
1951
1951
        """
1959
1959
                return callable(*args, **kwargs)
1960
1960
            else:
1961
1961
                # record this benchmark
1962
 
                ret, stats = bzrlib.lsprof.profile(callable, *args, **kwargs)
 
1962
                ret, stats = breezy.lsprof.profile(callable, *args, **kwargs)
1963
1963
                stats.sort()
1964
1964
                self._benchcalls.append(((callable, args, kwargs), stats))
1965
1965
                return ret
1970
1970
        trace.mutter(*args)
1971
1971
 
1972
1972
    def get_log(self):
1973
 
        """Get a unicode string containing the log from bzrlib.trace.
 
1973
        """Get a unicode string containing the log from breezy.trace.
1974
1974
 
1975
1975
        Undecodable characters are replaced.
1976
1976
        """
2007
2007
        stdout.encoding = encoding
2008
2008
        stderr.encoding = encoding
2009
2009
 
2010
 
        self.log('run bzr: %r', args)
 
2010
        self.log('run brz: %r', args)
2011
2011
        # FIXME: don't call into logging here
2012
2012
        handler = trace.EncodedStreamHandler(stderr, errors="replace",
2013
2013
            level=logging.INFO)
2058
2058
 
2059
2059
    def run_bzr(self, args, retcode=0, encoding=None, stdin=None,
2060
2060
                working_dir=None, error_regexes=[], output_encoding=None):
2061
 
        """Invoke bzr, as if it were run from the command line.
 
2061
        """Invoke brz, as if it were run from the command line.
2062
2062
 
2063
 
        The argument list should not include the bzr program name - the
2064
 
        first argument is normally the bzr command.  Arguments may be
 
2063
        The argument list should not include the brz program name - the
 
2064
        first argument is normally the brz command.  Arguments may be
2065
2065
        passed in three ways:
2066
2066
 
2067
2067
        1- A list of strings, eg ["commit", "a"].  This is recommended
2071
2071
        2- A single string, eg "add a".  This is the most convenient
2072
2072
        for hardcoded commands.
2073
2073
 
2074
 
        This runs bzr through the interface that catches and reports
 
2074
        This runs brz through the interface that catches and reports
2075
2075
        errors, and with logging set to something approximating the
2076
2076
        default, so that error reporting can be checked.
2077
2077
 
2078
2078
        This should be the main method for tests that want to exercise the
2079
 
        overall behavior of the bzr application (rather than a unit test
 
2079
        overall behavior of the brz application (rather than a unit test
2080
2080
        or a functional test of the library.)
2081
2081
 
2082
2082
        This sends the stdout/stderr results into the test's log,
2102
2102
        return out, err
2103
2103
 
2104
2104
    def run_bzr_error(self, error_regexes, *args, **kwargs):
2105
 
        """Run bzr, and check that stderr contains the supplied regexes
 
2105
        """Run brz, and check that stderr contains the supplied regexes
2106
2106
 
2107
2107
        :param error_regexes: Sequence of regular expressions which
2108
2108
            must each be found in the error output. The relative ordering
2109
2109
            is not enforced.
2110
 
        :param args: command-line arguments for bzr
2111
 
        :param kwargs: Keyword arguments which are interpreted by run_bzr
 
2110
        :param args: command-line arguments for brz
 
2111
        :param kwargs: Keyword arguments which are interpreted by run_brz
2112
2112
            This function changes the default value of retcode to be 3,
2113
 
            since in most cases this is run when you expect bzr to fail.
 
2113
            since in most cases this is run when you expect brz to fail.
2114
2114
 
2115
2115
        :return: (out, err) The actual output of running the command (in case
2116
2116
            you want to do more inspection)
2132
2132
        return out, err
2133
2133
 
2134
2134
    def run_bzr_subprocess(self, *args, **kwargs):
2135
 
        """Run bzr in a subprocess for testing.
 
2135
        """Run brz in a subprocess for testing.
2136
2136
 
2137
 
        This starts a new Python interpreter and runs bzr in there.
 
2137
        This starts a new Python interpreter and runs brz in there.
2138
2138
        This should only be used for tests that have a justifiable need for
2139
2139
        this isolation: e.g. they are testing startup time, or signal
2140
2140
        handling, or early startup code, etc.  Subprocess code can't be
2175
2175
                             skip_if_plan_to_signal=False,
2176
2176
                             working_dir=None,
2177
2177
                             allow_plugins=False, stderr=subprocess.PIPE):
2178
 
        """Start bzr in a subprocess for testing.
 
2178
        """Start brz in a subprocess for testing.
2179
2179
 
2180
 
        This starts a new Python interpreter and runs bzr in there.
 
2180
        This starts a new Python interpreter and runs brz in there.
2181
2181
        This should only be used for tests that have a justifiable need for
2182
2182
        this isolation: e.g. they are testing startup time, or signal
2183
2183
        handling, or early startup code, etc.  Subprocess code can't be
2184
2184
        profiled or debugged so easily.
2185
2185
 
2186
 
        :param process_args: a list of arguments to pass to the bzr executable,
 
2186
        :param process_args: a list of arguments to pass to the brz executable,
2187
2187
            for example ``['--version']``.
2188
2188
        :param env_changes: A dictionary which lists changes to environment
2189
2189
            variables. A value of None will unset the env variable.
2191
2191
            child, so you don't need to fix the environment after running.
2192
2192
        :param skip_if_plan_to_signal: raise TestSkipped when true and system
2193
2193
            doesn't support signalling subprocesses.
2194
 
        :param allow_plugins: If False (default) pass --no-plugins to bzr.
 
2194
        :param allow_plugins: If False (default) pass --no-plugins to brz.
2195
2195
        :param stderr: file to use for the subprocess's stderr.  Valid values
2196
2196
            are those valid for the stderr argument of `subprocess.Popen`.
2197
2197
            Default value is ``subprocess.PIPE``.
2219
2219
            for env_var, value in old_env.iteritems():
2220
2220
                osutils.set_or_unset_env(env_var, value)
2221
2221
 
2222
 
        bzr_path = self.get_bzr_path()
 
2222
        bzr_path = self.get_brz_path()
2223
2223
 
2224
2224
        cwd = None
2225
2225
        if working_dir is not None:
2233
2233
            cleanup_environment()
2234
2234
            # Include the subprocess's log file in the test details, in case
2235
2235
            # the test fails due to an error in the subprocess.
2236
 
            self._add_subprocess_log(trace._get_bzr_log_filename())
 
2236
            self._add_subprocess_log(trace._get_brz_log_filename())
2237
2237
            command = [sys.executable]
2238
2238
            # frozen executables don't need the path to bzr
2239
2239
            if getattr(sys, "frozen", None) is None:
2287
2287
        return subprocess.Popen(*args, **kwargs)
2288
2288
 
2289
2289
    def get_source_path(self):
2290
 
        """Return the path of the directory containing bzrlib."""
2291
 
        return os.path.dirname(os.path.dirname(bzrlib.__file__))
 
2290
        """Return the path of the directory containing breezy."""
 
2291
        return os.path.dirname(os.path.dirname(breezy.__file__))
2292
2292
 
2293
 
    def get_bzr_path(self):
2294
 
        """Return the path of the 'bzr' executable for this test suite."""
2295
 
        bzr_path = os.path.join(self.get_source_path(), "bzr")
2296
 
        if not os.path.isfile(bzr_path):
 
2293
    def get_brz_path(self):
 
2294
        """Return the path of the 'brz' executable for this test suite."""
 
2295
        brz_path = os.path.join(self.get_source_path(), "brz")
 
2296
        if not os.path.isfile(brz_path):
2297
2297
            # We are probably installed. Assume sys.argv is the right file
2298
 
            bzr_path = sys.argv[0]
2299
 
        return bzr_path
 
2298
            brz_path = sys.argv[0]
 
2299
        return brz_path
2300
2300
 
2301
2301
    def finish_bzr_subprocess(self, process, retcode=0, send_signal=None,
2302
2302
                              universal_newlines=False, process_args=None):
2320
2320
        if retcode is not None and retcode != process.returncode:
2321
2321
            if process_args is None:
2322
2322
                process_args = "(unknown args)"
2323
 
            trace.mutter('Output of bzr %s:\n%s', process_args, out)
2324
 
            trace.mutter('Error for bzr %s:\n%s', process_args, err)
2325
 
            self.fail('Command bzr %s failed with retcode %s != %s'
 
2323
            trace.mutter('Output of brz %s:\n%s', process_args, out)
 
2324
            trace.mutter('Error for brz %s:\n%s', process_args, err)
 
2325
            self.fail('Command brz %s failed with retcode %s != %s'
2326
2326
                      % (process_args, retcode, process.returncode))
2327
2327
        return [out, err]
2328
2328
 
2402
2402
 
2403
2403
    def disable_verb(self, verb):
2404
2404
        """Disable a smart server verb for one test."""
2405
 
        from bzrlib.smart import request
 
2405
        from breezy.smart import request
2406
2406
        request_handlers = request.request_handlers
2407
2407
        orig_method = request_handlers.get(verb)
2408
2408
        orig_info = request_handlers.get_info(verb)
2440
2440
    Tests that need disk resources should derive from TestCaseInTempDir
2441
2441
    orTestCaseWithTransport.
2442
2442
 
2443
 
    TestCaseWithMemoryTransport sets the TEST_ROOT variable for all bzr tests.
 
2443
    TestCaseWithMemoryTransport sets the TEST_ROOT variable for all brz tests.
2444
2444
 
2445
2445
    For TestCaseWithMemoryTransport the ``test_home_dir`` is set to the name of
2446
2446
    a directory which does not exist. This serves to help ensure test isolation
2644
2644
        """
2645
2645
        root = TestCaseWithMemoryTransport.TEST_ROOT
2646
2646
        try:
2647
 
            # Make sure we get a readable and accessible home for .bzr.log
 
2647
            # Make sure we get a readable and accessible home for .brz.log
2648
2648
            # and/or config files, and not fallback to weird defaults (see
2649
2649
            # http://pad.lv/825027).
2650
 
            self.assertIs(None, os.environ.get('BZR_HOME', None))
2651
 
            os.environ['BZR_HOME'] = root
 
2650
            self.assertIs(None, os.environ.get('BRZ_HOME', None))
 
2651
            os.environ['BRZ_HOME'] = root
2652
2652
            wt = controldir.ControlDir.create_standalone_workingtree(root)
2653
 
            del os.environ['BZR_HOME']
 
2653
            del os.environ['BRZ_HOME']
2654
2654
        except Exception, e:
2655
2655
            self.fail("Fail to initialize the safety net: %r\n" % (e,))
2656
2656
        # Hack for speed: remember the raw bytes of the dirstate file so that
2779
2779
        if isinstance(test_home_dir, unicode):
2780
2780
            test_home_dir = test_home_dir.encode(sys.getfilesystemencoding())
2781
2781
        self.overrideEnv('HOME', test_home_dir)
2782
 
        self.overrideEnv('BZR_HOME', test_home_dir)
 
2782
        self.overrideEnv('BRZ_HOME', test_home_dir)
2783
2783
 
2784
2784
    def setup_smart_server_with_call_log(self):
2785
2785
        """Sets up a smart server as the transport server with a call log."""
2831
2831
        super(TestCaseInTempDir, self).setUp()
2832
2832
        # Remove the protection set in isolated_environ, we have a proper
2833
2833
        # access to disk resources now.
2834
 
        self.overrideEnv('BZR_LOG', None)
 
2834
        self.overrideEnv('BRZ_LOG', None)
2835
2835
 
2836
2836
    def check_file_contents(self, filename, expect):
2837
2837
        self.log("check contents of file %s" % filename)
3087
3087
    """
3088
3088
 
3089
3089
    def setUp(self):
3090
 
        from bzrlib.tests import http_server
 
3090
        from breezy.tests import http_server
3091
3091
        super(ChrootedTestCase, self).setUp()
3092
3092
        if not self.vfs_transport_factory == memory.MemoryServer:
3093
3093
            self.transport_readonly_server = http_server.HttpServer
3295
3295
              stream=None,
3296
3296
              result_decorators=None,
3297
3297
              ):
3298
 
    """Run a test suite for bzr selftest.
 
3298
    """Run a test suite for brz selftest.
3299
3299
 
3300
3300
    :param runner_class: The class of runner to use. Must support the
3301
3301
        constructor arguments passed by run_suite which are more than standard
3615
3615
    test_blocks = partition_tests(suite, concurrency)
3616
3616
    for process_tests in test_blocks:
3617
3617
        # ugly; currently reimplement rather than reuses TestCase methods.
3618
 
        bzr_path = os.path.dirname(os.path.dirname(bzrlib.__file__))+'/bzr'
 
3618
        bzr_path = os.path.dirname(os.path.dirname(breezy.__file__))+'/bzr'
3619
3619
        if not os.path.isfile(bzr_path):
3620
3620
            # We are probably installed. Assume sys.argv is the right file
3621
3621
            bzr_path = sys.argv[0]
3660
3660
    """
3661
3661
 
3662
3662
    def startTest(self, test):
3663
 
        self.profiler = bzrlib.lsprof.BzrProfiler()
 
3663
        self.profiler = breezy.lsprof.BzrProfiler()
3664
3664
        # Prevent deadlocks in tests that use lsprof: those tests will
3665
3665
        # unavoidably fail.
3666
 
        bzrlib.lsprof.BzrProfiler.profiler_block = 0
 
3666
        breezy.lsprof.BzrProfiler.profiler_block = 0
3667
3667
        self.profiler.start()
3668
3668
        testtools.ExtendedToOriginalDecorator.startTest(self, test)
3669
3669
 
3682
3682
        self.profiler = None
3683
3683
 
3684
3684
 
3685
 
# Controlled by "bzr selftest -E=..." option
 
3685
# Controlled by "brz selftest -E=..." option
3686
3686
# Currently supported:
3687
3687
#   -Eallow_debug           Will no longer clear debug.debug_flags() so it
3688
3688
#                           preserves any flags supplied at the command line.
3720
3720
    # XXX: Very ugly way to do this...
3721
3721
    # Disable warning about old formats because we don't want it to disturb
3722
3722
    # any blackbox tests.
3723
 
    from bzrlib import repository
 
3723
    from breezy import repository
3724
3724
    repository._deprecation_warning_done = True
3725
3725
 
3726
3726
    global default_transport
3917
3917
 
3918
3918
 
3919
3919
# This alias allows to detect typos ('bzrlin.') by making all valid test ids
3920
 
# appear prefixed ('bzrlib.' is "replaced" by 'bzrlib.').
3921
 
test_prefix_alias_registry.register('bzrlib', 'bzrlib')
 
3920
# appear prefixed ('breezy.' is "replaced" by 'breezy.').
 
3921
test_prefix_alias_registry.register('breezy', 'breezy')
3922
3922
 
3923
3923
# Obvious highest levels prefixes, feel free to add your own via a plugin
3924
 
test_prefix_alias_registry.register('bd', 'bzrlib.doc')
3925
 
test_prefix_alias_registry.register('bu', 'bzrlib.utils')
3926
 
test_prefix_alias_registry.register('bt', 'bzrlib.tests')
3927
 
test_prefix_alias_registry.register('bb', 'bzrlib.tests.blackbox')
3928
 
test_prefix_alias_registry.register('bp', 'bzrlib.plugins')
 
3924
test_prefix_alias_registry.register('bd', 'breezy.doc')
 
3925
test_prefix_alias_registry.register('bu', 'breezy.utils')
 
3926
test_prefix_alias_registry.register('bt', 'breezy.tests')
 
3927
test_prefix_alias_registry.register('bb', 'breezy.tests.blackbox')
 
3928
test_prefix_alias_registry.register('bp', 'breezy.plugins')
3929
3929
 
3930
3930
 
3931
3931
def _test_suite_testmod_names():
3932
3932
    """Return the standard list of test module names to test."""
3933
3933
    return [
3934
 
        'bzrlib.doc',
3935
 
        'bzrlib.tests.blackbox',
3936
 
        'bzrlib.tests.commands',
3937
 
        'bzrlib.tests.per_branch',
3938
 
        'bzrlib.tests.per_bzrdir',
3939
 
        'bzrlib.tests.per_controldir',
3940
 
        'bzrlib.tests.per_controldir_colo',
3941
 
        'bzrlib.tests.per_foreign_vcs',
3942
 
        'bzrlib.tests.per_interrepository',
3943
 
        'bzrlib.tests.per_intertree',
3944
 
        'bzrlib.tests.per_inventory',
3945
 
        'bzrlib.tests.per_interbranch',
3946
 
        'bzrlib.tests.per_lock',
3947
 
        'bzrlib.tests.per_merger',
3948
 
        'bzrlib.tests.per_transport',
3949
 
        'bzrlib.tests.per_tree',
3950
 
        'bzrlib.tests.per_pack_repository',
3951
 
        'bzrlib.tests.per_repository',
3952
 
        'bzrlib.tests.per_repository_chk',
3953
 
        'bzrlib.tests.per_repository_reference',
3954
 
        'bzrlib.tests.per_repository_vf',
3955
 
        'bzrlib.tests.per_uifactory',
3956
 
        'bzrlib.tests.per_versionedfile',
3957
 
        'bzrlib.tests.per_workingtree',
3958
 
        'bzrlib.tests.test__annotator',
3959
 
        'bzrlib.tests.test__bencode',
3960
 
        'bzrlib.tests.test__btree_serializer',
3961
 
        'bzrlib.tests.test__chk_map',
3962
 
        'bzrlib.tests.test__dirstate_helpers',
3963
 
        'bzrlib.tests.test__groupcompress',
3964
 
        'bzrlib.tests.test__known_graph',
3965
 
        'bzrlib.tests.test__rio',
3966
 
        'bzrlib.tests.test__simple_set',
3967
 
        'bzrlib.tests.test__static_tuple',
3968
 
        'bzrlib.tests.test__walkdirs_win32',
3969
 
        'bzrlib.tests.test_ancestry',
3970
 
        'bzrlib.tests.test_annotate',
3971
 
        'bzrlib.tests.test_api',
3972
 
        'bzrlib.tests.test_atomicfile',
3973
 
        'bzrlib.tests.test_bad_files',
3974
 
        'bzrlib.tests.test_bisect_multi',
3975
 
        'bzrlib.tests.test_branch',
3976
 
        'bzrlib.tests.test_branchbuilder',
3977
 
        'bzrlib.tests.test_btree_index',
3978
 
        'bzrlib.tests.test_bugtracker',
3979
 
        'bzrlib.tests.test_bundle',
3980
 
        'bzrlib.tests.test_bzrdir',
3981
 
        'bzrlib.tests.test__chunks_to_lines',
3982
 
        'bzrlib.tests.test_cache_utf8',
3983
 
        'bzrlib.tests.test_chk_map',
3984
 
        'bzrlib.tests.test_chk_serializer',
3985
 
        'bzrlib.tests.test_chunk_writer',
3986
 
        'bzrlib.tests.test_clean_tree',
3987
 
        'bzrlib.tests.test_cleanup',
3988
 
        'bzrlib.tests.test_cmdline',
3989
 
        'bzrlib.tests.test_commands',
3990
 
        'bzrlib.tests.test_commit',
3991
 
        'bzrlib.tests.test_commit_merge',
3992
 
        'bzrlib.tests.test_config',
3993
 
        'bzrlib.tests.test_conflicts',
3994
 
        'bzrlib.tests.test_controldir',
3995
 
        'bzrlib.tests.test_counted_lock',
3996
 
        'bzrlib.tests.test_crash',
3997
 
        'bzrlib.tests.test_decorators',
3998
 
        'bzrlib.tests.test_delta',
3999
 
        'bzrlib.tests.test_debug',
4000
 
        'bzrlib.tests.test_diff',
4001
 
        'bzrlib.tests.test_directory_service',
4002
 
        'bzrlib.tests.test_dirstate',
4003
 
        'bzrlib.tests.test_email_message',
4004
 
        'bzrlib.tests.test_eol_filters',
4005
 
        'bzrlib.tests.test_errors',
4006
 
        'bzrlib.tests.test_estimate_compressed_size',
4007
 
        'bzrlib.tests.test_export',
4008
 
        'bzrlib.tests.test_export_pot',
4009
 
        'bzrlib.tests.test_extract',
4010
 
        'bzrlib.tests.test_features',
4011
 
        'bzrlib.tests.test_fetch',
4012
 
        'bzrlib.tests.test_fixtures',
4013
 
        'bzrlib.tests.test_fifo_cache',
4014
 
        'bzrlib.tests.test_filters',
4015
 
        'bzrlib.tests.test_filter_tree',
4016
 
        'bzrlib.tests.test_ftp_transport',
4017
 
        'bzrlib.tests.test_foreign',
4018
 
        'bzrlib.tests.test_generate_docs',
4019
 
        'bzrlib.tests.test_generate_ids',
4020
 
        'bzrlib.tests.test_globbing',
4021
 
        'bzrlib.tests.test_gpg',
4022
 
        'bzrlib.tests.test_graph',
4023
 
        'bzrlib.tests.test_groupcompress',
4024
 
        'bzrlib.tests.test_hashcache',
4025
 
        'bzrlib.tests.test_help',
4026
 
        'bzrlib.tests.test_hooks',
4027
 
        'bzrlib.tests.test_http',
4028
 
        'bzrlib.tests.test_http_response',
4029
 
        'bzrlib.tests.test_https_ca_bundle',
4030
 
        'bzrlib.tests.test_https_urllib',
4031
 
        'bzrlib.tests.test_i18n',
4032
 
        'bzrlib.tests.test_identitymap',
4033
 
        'bzrlib.tests.test_ignores',
4034
 
        'bzrlib.tests.test_index',
4035
 
        'bzrlib.tests.test_import_tariff',
4036
 
        'bzrlib.tests.test_info',
4037
 
        'bzrlib.tests.test_inv',
4038
 
        'bzrlib.tests.test_inventory_delta',
4039
 
        'bzrlib.tests.test_knit',
4040
 
        'bzrlib.tests.test_lazy_import',
4041
 
        'bzrlib.tests.test_lazy_regex',
4042
 
        'bzrlib.tests.test_library_state',
4043
 
        'bzrlib.tests.test_lock',
4044
 
        'bzrlib.tests.test_lockable_files',
4045
 
        'bzrlib.tests.test_lockdir',
4046
 
        'bzrlib.tests.test_log',
4047
 
        'bzrlib.tests.test_lru_cache',
4048
 
        'bzrlib.tests.test_lsprof',
4049
 
        'bzrlib.tests.test_mail_client',
4050
 
        'bzrlib.tests.test_matchers',
4051
 
        'bzrlib.tests.test_memorytree',
4052
 
        'bzrlib.tests.test_merge',
4053
 
        'bzrlib.tests.test_merge3',
4054
 
        'bzrlib.tests.test_merge_core',
4055
 
        'bzrlib.tests.test_merge_directive',
4056
 
        'bzrlib.tests.test_mergetools',
4057
 
        'bzrlib.tests.test_missing',
4058
 
        'bzrlib.tests.test_msgeditor',
4059
 
        'bzrlib.tests.test_multiparent',
4060
 
        'bzrlib.tests.test_mutabletree',
4061
 
        'bzrlib.tests.test_nonascii',
4062
 
        'bzrlib.tests.test_options',
4063
 
        'bzrlib.tests.test_osutils',
4064
 
        'bzrlib.tests.test_osutils_encodings',
4065
 
        'bzrlib.tests.test_pack',
4066
 
        'bzrlib.tests.test_patch',
4067
 
        'bzrlib.tests.test_patches',
4068
 
        'bzrlib.tests.test_permissions',
4069
 
        'bzrlib.tests.test_plugins',
4070
 
        'bzrlib.tests.test_progress',
4071
 
        'bzrlib.tests.test_pyutils',
4072
 
        'bzrlib.tests.test_read_bundle',
4073
 
        'bzrlib.tests.test_reconcile',
4074
 
        'bzrlib.tests.test_reconfigure',
4075
 
        'bzrlib.tests.test_registry',
4076
 
        'bzrlib.tests.test_remote',
4077
 
        'bzrlib.tests.test_rename_map',
4078
 
        'bzrlib.tests.test_repository',
4079
 
        'bzrlib.tests.test_revert',
4080
 
        'bzrlib.tests.test_revision',
4081
 
        'bzrlib.tests.test_revisionspec',
4082
 
        'bzrlib.tests.test_revisiontree',
4083
 
        'bzrlib.tests.test_rio',
4084
 
        'bzrlib.tests.test_rules',
4085
 
        'bzrlib.tests.test_url_policy_open',
4086
 
        'bzrlib.tests.test_sampler',
4087
 
        'bzrlib.tests.test_scenarios',
4088
 
        'bzrlib.tests.test_script',
4089
 
        'bzrlib.tests.test_selftest',
4090
 
        'bzrlib.tests.test_serializer',
4091
 
        'bzrlib.tests.test_setup',
4092
 
        'bzrlib.tests.test_sftp_transport',
4093
 
        'bzrlib.tests.test_shelf',
4094
 
        'bzrlib.tests.test_shelf_ui',
4095
 
        'bzrlib.tests.test_smart',
4096
 
        'bzrlib.tests.test_smart_add',
4097
 
        'bzrlib.tests.test_smart_request',
4098
 
        'bzrlib.tests.test_smart_signals',
4099
 
        'bzrlib.tests.test_smart_transport',
4100
 
        'bzrlib.tests.test_smtp_connection',
4101
 
        'bzrlib.tests.test_source',
4102
 
        'bzrlib.tests.test_ssh_transport',
4103
 
        'bzrlib.tests.test_status',
4104
 
        'bzrlib.tests.test_store',
4105
 
        'bzrlib.tests.test_strace',
4106
 
        'bzrlib.tests.test_subsume',
4107
 
        'bzrlib.tests.test_switch',
4108
 
        'bzrlib.tests.test_symbol_versioning',
4109
 
        'bzrlib.tests.test_tag',
4110
 
        'bzrlib.tests.test_test_server',
4111
 
        'bzrlib.tests.test_testament',
4112
 
        'bzrlib.tests.test_textfile',
4113
 
        'bzrlib.tests.test_textmerge',
4114
 
        'bzrlib.tests.test_cethread',
4115
 
        'bzrlib.tests.test_timestamp',
4116
 
        'bzrlib.tests.test_trace',
4117
 
        'bzrlib.tests.test_transactions',
4118
 
        'bzrlib.tests.test_transform',
4119
 
        'bzrlib.tests.test_transport',
4120
 
        'bzrlib.tests.test_transport_log',
4121
 
        'bzrlib.tests.test_tree',
4122
 
        'bzrlib.tests.test_treebuilder',
4123
 
        'bzrlib.tests.test_treeshape',
4124
 
        'bzrlib.tests.test_tsort',
4125
 
        'bzrlib.tests.test_tuned_gzip',
4126
 
        'bzrlib.tests.test_ui',
4127
 
        'bzrlib.tests.test_uncommit',
4128
 
        'bzrlib.tests.test_upgrade',
4129
 
        'bzrlib.tests.test_upgrade_stacked',
4130
 
        'bzrlib.tests.test_urlutils',
4131
 
        'bzrlib.tests.test_utextwrap',
4132
 
        'bzrlib.tests.test_version',
4133
 
        'bzrlib.tests.test_version_info',
4134
 
        'bzrlib.tests.test_versionedfile',
4135
 
        'bzrlib.tests.test_vf_search',
4136
 
        'bzrlib.tests.test_weave',
4137
 
        'bzrlib.tests.test_whitebox',
4138
 
        'bzrlib.tests.test_win32utils',
4139
 
        'bzrlib.tests.test_workingtree',
4140
 
        'bzrlib.tests.test_workingtree_4',
4141
 
        'bzrlib.tests.test_wsgi',
4142
 
        'bzrlib.tests.test_xml',
 
3934
        'breezy.doc',
 
3935
        'breezy.tests.blackbox',
 
3936
        'breezy.tests.commands',
 
3937
        'breezy.tests.per_branch',
 
3938
        'breezy.tests.per_bzrdir',
 
3939
        'breezy.tests.per_controldir',
 
3940
        'breezy.tests.per_controldir_colo',
 
3941
        'breezy.tests.per_foreign_vcs',
 
3942
        'breezy.tests.per_interrepository',
 
3943
        'breezy.tests.per_intertree',
 
3944
        'breezy.tests.per_inventory',
 
3945
        'breezy.tests.per_interbranch',
 
3946
        'breezy.tests.per_lock',
 
3947
        'breezy.tests.per_merger',
 
3948
        'breezy.tests.per_transport',
 
3949
        'breezy.tests.per_tree',
 
3950
        'breezy.tests.per_pack_repository',
 
3951
        'breezy.tests.per_repository',
 
3952
        'breezy.tests.per_repository_chk',
 
3953
        'breezy.tests.per_repository_reference',
 
3954
        'breezy.tests.per_repository_vf',
 
3955
        'breezy.tests.per_uifactory',
 
3956
        'breezy.tests.per_versionedfile',
 
3957
        'breezy.tests.per_workingtree',
 
3958
        'breezy.tests.test__annotator',
 
3959
        'breezy.tests.test__bencode',
 
3960
        'breezy.tests.test__btree_serializer',
 
3961
        'breezy.tests.test__chk_map',
 
3962
        'breezy.tests.test__dirstate_helpers',
 
3963
        'breezy.tests.test__groupcompress',
 
3964
        'breezy.tests.test__known_graph',
 
3965
        'breezy.tests.test__rio',
 
3966
        'breezy.tests.test__simple_set',
 
3967
        'breezy.tests.test__static_tuple',
 
3968
        'breezy.tests.test__walkdirs_win32',
 
3969
        'breezy.tests.test_ancestry',
 
3970
        'breezy.tests.test_annotate',
 
3971
        'breezy.tests.test_api',
 
3972
        'breezy.tests.test_atomicfile',
 
3973
        'breezy.tests.test_bad_files',
 
3974
        'breezy.tests.test_bisect_multi',
 
3975
        'breezy.tests.test_branch',
 
3976
        'breezy.tests.test_branchbuilder',
 
3977
        'breezy.tests.test_btree_index',
 
3978
        'breezy.tests.test_bugtracker',
 
3979
        'breezy.tests.test_bundle',
 
3980
        'breezy.tests.test_bzrdir',
 
3981
        'breezy.tests.test__chunks_to_lines',
 
3982
        'breezy.tests.test_cache_utf8',
 
3983
        'breezy.tests.test_chk_map',
 
3984
        'breezy.tests.test_chk_serializer',
 
3985
        'breezy.tests.test_chunk_writer',
 
3986
        'breezy.tests.test_clean_tree',
 
3987
        'breezy.tests.test_cleanup',
 
3988
        'breezy.tests.test_cmdline',
 
3989
        'breezy.tests.test_commands',
 
3990
        'breezy.tests.test_commit',
 
3991
        'breezy.tests.test_commit_merge',
 
3992
        'breezy.tests.test_config',
 
3993
        'breezy.tests.test_conflicts',
 
3994
        'breezy.tests.test_controldir',
 
3995
        'breezy.tests.test_counted_lock',
 
3996
        'breezy.tests.test_crash',
 
3997
        'breezy.tests.test_decorators',
 
3998
        'breezy.tests.test_delta',
 
3999
        'breezy.tests.test_debug',
 
4000
        'breezy.tests.test_diff',
 
4001
        'breezy.tests.test_directory_service',
 
4002
        'breezy.tests.test_dirstate',
 
4003
        'breezy.tests.test_email_message',
 
4004
        'breezy.tests.test_eol_filters',
 
4005
        'breezy.tests.test_errors',
 
4006
        'breezy.tests.test_estimate_compressed_size',
 
4007
        'breezy.tests.test_export',
 
4008
        'breezy.tests.test_export_pot',
 
4009
        'breezy.tests.test_extract',
 
4010
        'breezy.tests.test_features',
 
4011
        'breezy.tests.test_fetch',
 
4012
        'breezy.tests.test_fixtures',
 
4013
        'breezy.tests.test_fifo_cache',
 
4014
        'breezy.tests.test_filters',
 
4015
        'breezy.tests.test_filter_tree',
 
4016
        'breezy.tests.test_ftp_transport',
 
4017
        'breezy.tests.test_foreign',
 
4018
        'breezy.tests.test_generate_docs',
 
4019
        'breezy.tests.test_generate_ids',
 
4020
        'breezy.tests.test_globbing',
 
4021
        'breezy.tests.test_gpg',
 
4022
        'breezy.tests.test_graph',
 
4023
        'breezy.tests.test_groupcompress',
 
4024
        'breezy.tests.test_hashcache',
 
4025
        'breezy.tests.test_help',
 
4026
        'breezy.tests.test_hooks',
 
4027
        'breezy.tests.test_http',
 
4028
        'breezy.tests.test_http_response',
 
4029
        'breezy.tests.test_https_ca_bundle',
 
4030
        'breezy.tests.test_https_urllib',
 
4031
        'breezy.tests.test_i18n',
 
4032
        'breezy.tests.test_identitymap',
 
4033
        'breezy.tests.test_ignores',
 
4034
        'breezy.tests.test_index',
 
4035
        'breezy.tests.test_import_tariff',
 
4036
        'breezy.tests.test_info',
 
4037
        'breezy.tests.test_inv',
 
4038
        'breezy.tests.test_inventory_delta',
 
4039
        'breezy.tests.test_knit',
 
4040
        'breezy.tests.test_lazy_import',
 
4041
        'breezy.tests.test_lazy_regex',
 
4042
        'breezy.tests.test_library_state',
 
4043
        'breezy.tests.test_lock',
 
4044
        'breezy.tests.test_lockable_files',
 
4045
        'breezy.tests.test_lockdir',
 
4046
        'breezy.tests.test_log',
 
4047
        'breezy.tests.test_lru_cache',
 
4048
        'breezy.tests.test_lsprof',
 
4049
        'breezy.tests.test_mail_client',
 
4050
        'breezy.tests.test_matchers',
 
4051
        'breezy.tests.test_memorytree',
 
4052
        'breezy.tests.test_merge',
 
4053
        'breezy.tests.test_merge3',
 
4054
        'breezy.tests.test_merge_core',
 
4055
        'breezy.tests.test_merge_directive',
 
4056
        'breezy.tests.test_mergetools',
 
4057
        'breezy.tests.test_missing',
 
4058
        'breezy.tests.test_msgeditor',
 
4059
        'breezy.tests.test_multiparent',
 
4060
        'breezy.tests.test_mutabletree',
 
4061
        'breezy.tests.test_nonascii',
 
4062
        'breezy.tests.test_options',
 
4063
        'breezy.tests.test_osutils',
 
4064
        'breezy.tests.test_osutils_encodings',
 
4065
        'breezy.tests.test_pack',
 
4066
        'breezy.tests.test_patch',
 
4067
        'breezy.tests.test_patches',
 
4068
        'breezy.tests.test_permissions',
 
4069
        'breezy.tests.test_plugins',
 
4070
        'breezy.tests.test_progress',
 
4071
        'breezy.tests.test_pyutils',
 
4072
        'breezy.tests.test_read_bundle',
 
4073
        'breezy.tests.test_reconcile',
 
4074
        'breezy.tests.test_reconfigure',
 
4075
        'breezy.tests.test_registry',
 
4076
        'breezy.tests.test_remote',
 
4077
        'breezy.tests.test_rename_map',
 
4078
        'breezy.tests.test_repository',
 
4079
        'breezy.tests.test_revert',
 
4080
        'breezy.tests.test_revision',
 
4081
        'breezy.tests.test_revisionspec',
 
4082
        'breezy.tests.test_revisiontree',
 
4083
        'breezy.tests.test_rio',
 
4084
        'breezy.tests.test_rules',
 
4085
        'breezy.tests.test_url_policy_open',
 
4086
        'breezy.tests.test_sampler',
 
4087
        'breezy.tests.test_scenarios',
 
4088
        'breezy.tests.test_script',
 
4089
        'breezy.tests.test_selftest',
 
4090
        'breezy.tests.test_serializer',
 
4091
        'breezy.tests.test_setup',
 
4092
        'breezy.tests.test_sftp_transport',
 
4093
        'breezy.tests.test_shelf',
 
4094
        'breezy.tests.test_shelf_ui',
 
4095
        'breezy.tests.test_smart',
 
4096
        'breezy.tests.test_smart_add',
 
4097
        'breezy.tests.test_smart_request',
 
4098
        'breezy.tests.test_smart_signals',
 
4099
        'breezy.tests.test_smart_transport',
 
4100
        'breezy.tests.test_smtp_connection',
 
4101
        'breezy.tests.test_source',
 
4102
        'breezy.tests.test_ssh_transport',
 
4103
        'breezy.tests.test_status',
 
4104
        'breezy.tests.test_store',
 
4105
        'breezy.tests.test_strace',
 
4106
        'breezy.tests.test_subsume',
 
4107
        'breezy.tests.test_switch',
 
4108
        'breezy.tests.test_symbol_versioning',
 
4109
        'breezy.tests.test_tag',
 
4110
        'breezy.tests.test_test_server',
 
4111
        'breezy.tests.test_testament',
 
4112
        'breezy.tests.test_textfile',
 
4113
        'breezy.tests.test_textmerge',
 
4114
        'breezy.tests.test_cethread',
 
4115
        'breezy.tests.test_timestamp',
 
4116
        'breezy.tests.test_trace',
 
4117
        'breezy.tests.test_transactions',
 
4118
        'breezy.tests.test_transform',
 
4119
        'breezy.tests.test_transport',
 
4120
        'breezy.tests.test_transport_log',
 
4121
        'breezy.tests.test_tree',
 
4122
        'breezy.tests.test_treebuilder',
 
4123
        'breezy.tests.test_treeshape',
 
4124
        'breezy.tests.test_tsort',
 
4125
        'breezy.tests.test_tuned_gzip',
 
4126
        'breezy.tests.test_ui',
 
4127
        'breezy.tests.test_uncommit',
 
4128
        'breezy.tests.test_upgrade',
 
4129
        'breezy.tests.test_upgrade_stacked',
 
4130
        'breezy.tests.test_urlutils',
 
4131
        'breezy.tests.test_utextwrap',
 
4132
        'breezy.tests.test_version',
 
4133
        'breezy.tests.test_version_info',
 
4134
        'breezy.tests.test_versionedfile',
 
4135
        'breezy.tests.test_vf_search',
 
4136
        'breezy.tests.test_weave',
 
4137
        'breezy.tests.test_whitebox',
 
4138
        'breezy.tests.test_win32utils',
 
4139
        'breezy.tests.test_workingtree',
 
4140
        'breezy.tests.test_workingtree_4',
 
4141
        'breezy.tests.test_wsgi',
 
4142
        'breezy.tests.test_xml',
4143
4143
        ]
4144
4144
 
4145
4145
 
4149
4149
        # GZ 2009-03-31: No docstrings with -OO so there's nothing to doctest
4150
4150
        return []
4151
4151
    return [
4152
 
        'bzrlib',
4153
 
        'bzrlib.branchbuilder',
4154
 
        'bzrlib.decorators',
4155
 
        'bzrlib.inventory',
4156
 
        'bzrlib.iterablefile',
4157
 
        'bzrlib.lockdir',
4158
 
        'bzrlib.merge3',
4159
 
        'bzrlib.option',
4160
 
        'bzrlib.pyutils',
4161
 
        'bzrlib.symbol_versioning',
4162
 
        'bzrlib.tests',
4163
 
        'bzrlib.tests.fixtures',
4164
 
        'bzrlib.timestamp',
4165
 
        'bzrlib.transport.http',
4166
 
        'bzrlib.version_info_formats.format_custom',
 
4152
        'breezy',
 
4153
        'breezy.branchbuilder',
 
4154
        'breezy.decorators',
 
4155
        'breezy.inventory',
 
4156
        'breezy.iterablefile',
 
4157
        'breezy.lockdir',
 
4158
        'breezy.merge3',
 
4159
        'breezy.option',
 
4160
        'breezy.pyutils',
 
4161
        'breezy.symbol_versioning',
 
4162
        'breezy.tests',
 
4163
        'breezy.tests.fixtures',
 
4164
        'breezy.timestamp',
 
4165
        'breezy.transport.http',
 
4166
        'breezy.version_info_formats.format_custom',
4167
4167
        ]
4168
4168
 
4169
4169
 
4170
4170
def test_suite(keep_only=None, starting_with=None):
4171
 
    """Build and return TestSuite for the whole of bzrlib.
 
4171
    """Build and return TestSuite for the whole of breezy.
4172
4172
 
4173
4173
    :param keep_only: A list of test ids limiting the suite returned.
4174
4174
 
4315
4315
    the scenario name at the end of its id(), and updating the test object's
4316
4316
    __dict__ with the scenario_param_dict.
4317
4317
 
4318
 
    >>> import bzrlib.tests.test_sampler
 
4318
    >>> import breezy.tests.test_sampler
4319
4319
    >>> r = multiply_tests(
4320
 
    ...     bzrlib.tests.test_sampler.DemoTest('test_nothing'),
 
4320
    ...     breezy.tests.test_sampler.DemoTest('test_nothing'),
4321
4321
    ...     [('one', dict(param=1)),
4322
4322
    ...      ('two', dict(param=2))],
4323
4323
    ...     TestUtil.TestSuite())
4325
4325
    >>> len(tests)
4326
4326
    2
4327
4327
    >>> tests[0].id()
4328
 
    'bzrlib.tests.test_sampler.DemoTest.test_nothing(one)'
 
4328
    'breezy.tests.test_sampler.DemoTest.test_nothing(one)'
4329
4329
    >>> tests[0].param
4330
4330
    1
4331
4331
    >>> tests[1].param
4397
4397
    This is meant to be used inside a modules 'load_tests()' function. It will
4398
4398
    create 2 scenarios, and cause all tests in the 'standard_tests' to be run
4399
4399
    against both implementations. Setting 'test.module' to the appropriate
4400
 
    module. See bzrlib.tests.test__chk_map.load_tests as an example.
 
4400
    module. See breezy.tests.test__chk_map.load_tests as an example.
4401
4401
 
4402
4402
    :param standard_tests: A test suite to permute
4403
4403
    :param loader: A TestLoader
4404
4404
    :param py_module_name: The python path to a python module that can always
4405
4405
        be loaded, and will be considered the 'python' implementation. (eg
4406
 
        'bzrlib._chk_map_py')
 
4406
        'breezy._chk_map_py')
4407
4407
    :param ext_module_name: The python path to an extension module. If the
4408
4408
        module cannot be loaded, a single test will be added, which notes that
4409
4409
        the module is not available. If it can be loaded, all standard_tests
4413
4413
        the module is available.
4414
4414
    """
4415
4415
 
4416
 
    from bzrlib.tests.features import ModuleAvailableFeature
 
4416
    from breezy.tests.features import ModuleAvailableFeature
4417
4417
    py_module = pyutils.get_named_object(py_module_name)
4418
4418
    scenarios = [
4419
4419
        ('python', {'module': py_module}),
4535
4535
    ]:
4536
4536
    globals()[name] = _CompatabilityThunkFeature(
4537
4537
        symbol_versioning.deprecated_in((2, 5, 0)),
4538
 
        'bzrlib.tests', name,
4539
 
        name, 'bzrlib.tests.features')
 
4538
        'breezy.tests', name,
 
4539
        name, 'breezy.tests.features')
4540
4540
 
4541
4541
 
4542
4542
for (old_name, new_name) in [
4544
4544
    ]:
4545
4545
    globals()[name] = _CompatabilityThunkFeature(
4546
4546
        symbol_versioning.deprecated_in((2, 5, 0)),
4547
 
        'bzrlib.tests', old_name,
4548
 
        new_name, 'bzrlib.tests.features')
 
4547
        'breezy.tests', old_name,
 
4548
        new_name, 'breezy.tests.features')