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

  • Committer: Andrew Bennetts
  • Date: 2008-08-12 14:53:26 UTC
  • mto: This revision was merged to the branch mainline in revision 3624.
  • Revision ID: andrew.bennetts@canonical.com-20080812145326-yx693x2jc4rcovb7
Move the notes on writing tests out of HACKING into a new file, and improve
them.

Many of the testing notes in the HACKING file were in duplicated in two places
in that file!  This change removes that duplication.  It also adds new sections
on “Where should I put a new test?” and “TestCase and its subclasses”, and
others like “Test feature dependencies” have been expanded.  The whole document
has generally been edited to be a bit more coherent. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2010 Canonical Ltd
 
1
# Copyright (C) 2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
import sys
18
18
from urllib import quote
143
143
                # We don't require that experimental formats support checkouts
144
144
                # or describe correctly in the UI.
145
145
                continue
146
 
            if bzrdir.format_registry.get_info(key).hidden:
147
 
                continue
148
146
            expected = None
149
 
            if key in ('pack-0.92',):
150
 
                expected = 'pack-0.92'
151
 
            elif key in ('knit', 'metaweave'):
 
147
            if key in ('dirstate', 'dirstate-tags', 'dirstate-with-subtree',
 
148
                'pack-0.92', 'pack-0.92-subtree', 'rich-root',
 
149
                'rich-root-pack', '1.6', '1.6-rich-root'):
 
150
                expected = '1.6 or 1.6-rich-root or ' \
 
151
                    'dirstate or dirstate-tags or pack-0.92 or'\
 
152
                    ' rich-root or rich-root-pack'
 
153
            if key in ('knit', 'metaweave'):
152
154
                expected = 'knit or metaweave'
153
 
            elif key in ('1.14', '1.14-rich-root'):
154
 
                expected = '1.14 or 1.14-rich-root'
155
155
            self.assertCheckoutDescription(key, expected)
156
156
 
157
157
    def test_describe_branch_format(self):
158
158
        for key in bzrdir.format_registry.keys():
159
159
            if key in bzrdir.format_registry.aliases():
160
160
                continue
161
 
            if bzrdir.format_registry.get_info(key).hidden:
162
 
                continue
163
161
            expected = None
164
162
            if key in ('dirstate', 'knit'):
165
163
                expected = 'dirstate or knit'
166
 
            elif key in ('1.14',):
167
 
                expected = '1.14'
168
 
            elif key in ('1.14-rich-root',):
169
 
                expected = '1.14-rich-root'
170
164
            self.assertBranchDescription(key, expected)
171
165
 
172
166
    def test_describe_repo_format(self):
173
167
        for key in bzrdir.format_registry.keys():
174
168
            if key in bzrdir.format_registry.aliases():
175
169
                continue
176
 
            if bzrdir.format_registry.get_info(key).hidden:
177
 
                continue
178
170
            expected = None
179
171
            if key in ('dirstate', 'knit', 'dirstate-tags'):
180
172
                expected = 'dirstate or dirstate-tags or knit'
181
 
            elif key in ('1.14',):
182
 
                expected = '1.14'
183
 
            elif key in ('1.14-rich-root',):
184
 
                expected = '1.14-rich-root'
185
173
            self.assertRepoDescription(key, expected)
186
174
 
187
175
        format = bzrdir.format_registry.make_bzrdir('metaweave')