~bzr-pqm/bzr/bzr.dev

5630.2.4 by John Arbash Meinel
Basically works in the case where the dirstate isn't corrupted.
1
# Copyright (C) 2005-2011 Canonical Ltd
1831.1.1 by Martin Pool
[merge] remove default ignore list & update
2
#
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
1831.1.1 by Martin Pool
[merge] remove default ignore list & update
7
#
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
1831.1.1 by Martin Pool
[merge] remove default ignore list & update
12
#
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
4183.7.1 by Sabin Iacob
update FSF mailing address
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
16
17
18
"""Black-box tests for bzr.
19
20
These check that it behaves properly when it's invoked through the regular
3943.8.1 by Marius Kruger
remove all trailing whitespace from bzr source
21
command-line interface. This doesn't actually run a new interpreter but
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
22
rather starts again from the run_bzr function.
23
"""
24
1692.3.3 by Robert Collins
Get run_bzr in tests to always assign a new, clean ui factory.
25
5283.4.1 by Martin Pool
Deprecate ExternalBase.check_output and update some callers to use scripts
26
from bzrlib.symbol_versioning import (
27
    deprecated_in,
28
    deprecated_method,
29
    )
5184.1.1 by Vincent Ladeuil
Random cleanups to catch up with copyright updates in trunk.
30
from bzrlib import tests
1570.1.2 by Robert Collins
Import bzrtools' 'fix' command as 'bzr reconcile.'
31
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
32
3302.9.6 by Vincent Ladeuil
bzrlib.tests.blackbox switched from test_suite() to load_tests().
33
def load_tests(basic_tests, module, loader):
34
    suite = loader.suiteClass()
35
    # add the tests for this module
36
    suite.addTests(basic_tests)
37
5455.1.1 by Vincent Ladeuil
Add a new hidden ``test-script`` command.
38
    prefix = 'bzrlib.tests.blackbox.'
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
39
    testmod_names = [
5455.1.1 by Vincent Ladeuil
Add a new hidden ``test-script`` command.
40
                     'test_add',
41
                     'test_added',
42
                     'test_alias',
43
                     'test_aliases',
44
                     'test_ancestry',
45
                     'test_annotate',
46
                     'test_branch',
6060.6.1 by Jelmer Vernooij
Add 'bzr branches' command.
47
                     'test_branches',
5455.1.1 by Vincent Ladeuil
Add a new hidden ``test-script`` command.
48
                     'test_break_lock',
49
                     'test_bound_branches',
50
                     'test_bundle_info',
51
                     'test_cat',
52
                     'test_cat_revision',
53
                     'test_check',
54
                     'test_checkout',
55
                     'test_clean_tree',
56
                     'test_command_encoding',
57
                     'test_commit',
5455.1.6 by Vincent Ladeuil
Merge bzr.dev
58
                     'test_config',
5455.1.1 by Vincent Ladeuil
Add a new hidden ``test-script`` command.
59
                     'test_conflicts',
60
                     'test_debug',
61
                     'test_deleted',
62
                     'test_diff',
63
                     'test_dump_btree',
64
                     'test_dpush',
65
                     'test_exceptions',
66
                     'test_export',
6162.4.6 by Jonathan Riddell
add blackbox test for export_pot
67
                     'test_export_pot',
5455.1.1 by Vincent Ladeuil
Add a new hidden ``test-script`` command.
68
                     'test_filesystem_cicp',
69
                     'test_filtered_view_ops',
70
                     'test_find_merge_base',
71
                     'test_help',
72
                     'test_hooks',
73
                     'test_ignore',
74
                     'test_ignored',
75
                     'test_info',
76
                     'test_init',
77
                     'test_inventory',
78
                     'test_join',
79
                     'test_locale',
80
                     'test_log',
81
                     'test_logformats',
82
                     'test_lookup_revision',
83
                     'test_ls',
84
                     'test_lsprof',
85
                     'test_merge',
86
                     'test_merge_directive',
87
                     'test_missing',
6352.1.1 by Jelmer Vernooij
add blackbox tests for mkdir.
88
                     'test_mkdir',
5455.1.1 by Vincent Ladeuil
Add a new hidden ``test-script`` command.
89
                     'test_modified',
90
                     'test_mv',
91
                     'test_nick',
92
                     'test_non_ascii',
93
                     'test_outside_wt',
94
                     'test_pack',
6556.2.3 by Jelmer Vernooij
Add basic test for ping.
95
                     'test_ping',
5455.1.1 by Vincent Ladeuil
Add a new hidden ``test-script`` command.
96
                     'test_pull',
97
                     'test_push',
98
                     'test_reconcile',
99
                     'test_reconfigure',
100
                     'test_reference',
101
                     'test_remerge',
102
                     'test_remove',
103
                     'test_re_sign',
5861.1.6 by Vincent Ladeuil
Make TestRemember a test class that can be reused for other commands.
104
                     'test_remember_option',
5455.1.1 by Vincent Ladeuil
Add a new hidden ``test-script`` command.
105
                     'test_remove_tree',
5630.2.8 by John Arbash Meinel
Rename the command to 'repair-workingtree' as mentioned by vila.
106
                     'test_repair_workingtree',
4597.9.19 by Vincent Ladeuil
resolve now reports conflicts resolved/remaining.
107
                     'test_resolve',
5455.1.1 by Vincent Ladeuil
Add a new hidden ``test-script`` command.
108
                     'test_revert',
109
                     'test_revno',
110
                     'test_revision_history',
111
                     'test_revision_info',
112
                     'test_rmbranch',
113
                     'test_script',
114
                     'test_selftest',
115
                     'test_send',
116
                     'test_serve',
117
                     'test_shared_repository',
6405.1.1 by Jelmer Vernooij
add really basic test for shell-complete command.
118
                     'test_shell_complete',
5455.1.1 by Vincent Ladeuil
Add a new hidden ``test-script`` command.
119
                     'test_shelve',
120
                     'test_sign_my_commits',
6583.4.4 by Reagan Sanders
Split the existing test cases for verify-signatures away from those for sign-my-commits and added test cases covering the --verbose option.
121
                     'test_verify_signatures',
5455.1.1 by Vincent Ladeuil
Add a new hidden ``test-script`` command.
122
                     'test_split',
123
                     'test_status',
124
                     'test_switch',
125
                     'test_tags',
126
                     'test_testament',
127
                     'test_too_much',
128
                     'test_uncommit',
129
                     'test_unknowns',
130
                     'test_update',
131
                     'test_upgrade',
132
                     'test_version',
133
                     'test_version_info',
134
                     'test_versioning',
135
                     'test_view',
136
                     'test_whoami',
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
137
                     ]
3302.9.27 by Vincent Ladeuil
Fixed as per Ian's review.
138
    # add the tests for the sub modules
5455.1.1 by Vincent Ladeuil
Add a new hidden ``test-script`` command.
139
    suite.addTests(loader.loadTestsFromModuleNames(
140
            [prefix + module_name for module_name in testmod_names]))
1185.85.24 by John Arbash Meinel
Moved run_bzr_decode into TestCase
141
    return suite
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
142
143
5184.1.1 by Vincent Ladeuil
Random cleanups to catch up with copyright updates in trunk.
144
class ExternalBase(tests.TestCaseWithTransport):
5283.4.5 by Martin Pool
Update remaining subclasses of ExternalBase
145
    """Don't use this class anymore, use TestCaseWithTransport or similar"""
1513 by Robert Collins
Blackbox tests are maintained within the bzrlib.tests.blackbox directory.
146
5283.4.1 by Martin Pool
Deprecate ExternalBase.check_output and update some callers to use scripts
147
    @deprecated_method(deprecated_in((2, 2, 0)))
1551.13.17 by Aaron Bentley
Move cat-revision tests out of test_revision_info
148
    def check_output(self, output, *args):
149
        """Verify that the expected output matches what bzr says.
150
151
        The output is supplied first, so that you can supply a variable
152
        number of arguments to bzr.
153
        """
2530.3.4 by Martin Pool
Deprecate run_bzr_captured in favour of just run_bzr
154
        self.assertEquals(self.run_bzr(*args)[0], output)