~bzr-pqm/bzr/bzr.dev

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# Copyright (C) 2005-2011 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA


"""Black-box tests for bzr.

These check that it behaves properly when it's invoked through the regular
command-line interface. This doesn't actually run a new interpreter but
rather starts again from the run_bzr function.
"""


from bzrlib.symbol_versioning import (
    deprecated_in,
    deprecated_method,
    )
from bzrlib import tests


def load_tests(basic_tests, module, loader):
    suite = loader.suiteClass()
    # add the tests for this module
    suite.addTests(basic_tests)

    prefix = 'bzrlib.tests.blackbox.'
    testmod_names = [
                     'test_add',
                     'test_added',
                     'test_alias',
                     'test_aliases',
                     'test_ancestry',
                     'test_annotate',
                     'test_branch',
                     'test_branches',
                     'test_break_lock',
                     'test_bound_branches',
                     'test_bundle_info',
                     'test_cat',
                     'test_cat_revision',
                     'test_check',
                     'test_checkout',
                     'test_clean_tree',
                     'test_command_encoding',
                     'test_commit',
                     'test_config',
                     'test_conflicts',
                     'test_debug',
                     'test_deleted',
                     'test_diff',
                     'test_dump_btree',
                     'test_dpush',
                     'test_exceptions',
                     'test_export',
                     'test_filesystem_cicp',
                     'test_filtered_view_ops',
                     'test_find_merge_base',
                     'test_help',
                     'test_hooks',
                     'test_ignore',
                     'test_ignored',
                     'test_info',
                     'test_init',
                     'test_inventory',
                     'test_join',
                     'test_locale',
                     'test_log',
                     'test_logformats',
                     'test_lookup_revision',
                     'test_ls',
                     'test_lsprof',
                     'test_merge',
                     'test_merge_directive',
                     'test_missing',
                     'test_modified',
                     'test_mv',
                     'test_nick',
                     'test_non_ascii',
                     'test_outside_wt',
                     'test_pack',
                     'test_pull',
                     'test_push',
                     'test_reconcile',
                     'test_reconfigure',
                     'test_reference',
                     'test_remerge',
                     'test_remove',
                     'test_re_sign',
                     'test_remember_option',
                     'test_remove_tree',
                     'test_repair_workingtree',
                     'test_resolve',
                     'test_revert',
                     'test_revno',
                     'test_revision_history',
                     'test_revision_info',
                     'test_rmbranch',
                     'test_script',
                     'test_selftest',
                     'test_send',
                     'test_serve',
                     'test_shared_repository',
                     'test_shelve',
                     'test_sign_my_commits',
                     'test_split',
                     'test_status',
                     'test_switch',
                     'test_tags',
                     'test_testament',
                     'test_too_much',
                     'test_uncommit',
                     'test_unknowns',
                     'test_update',
                     'test_upgrade',
                     'test_version',
                     'test_version_info',
                     'test_versioning',
                     'test_view',
                     'test_whoami',
                     ]
    # add the tests for the sub modules
    suite.addTests(loader.loadTestsFromModuleNames(
            [prefix + module_name for module_name in testmod_names]))
    return suite


class ExternalBase(tests.TestCaseWithTransport):
    """Don't use this class anymore, use TestCaseWithTransport or similar"""

    @deprecated_method(deprecated_in((2, 2, 0)))
    def check_output(self, output, *args):
        """Verify that the expected output matches what bzr says.

        The output is supplied first, so that you can supply a variable
        number of arguments to bzr.
        """
        self.assertEquals(self.run_bzr(*args)[0], output)