bzr branch
http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
|
5143.1.1
by Jelmer Vernooij
Add separate tests for BzrDirs with colocated branch support and |
1 |
# Copyright (C) 2010 Canonical Ltd
|
2 |
#
|
|
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.
|
|
7 |
#
|
|
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.
|
|
12 |
#
|
|
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
|
|
15 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
16 |
||
17 |
||
|
5143.1.3
by Jelmer Vernooij
Fix docstring. |
18 |
"""BzrDir implementation tests for colocated branch support.
|
|
5143.1.1
by Jelmer Vernooij
Add separate tests for BzrDirs with colocated branch support and |
19 |
|
|
5143.1.3
by Jelmer Vernooij
Fix docstring. |
20 |
These tests check the conformance of the colocated branches support.
|
21 |
All bzrdir formats are tested - those that do not suppport colocated branches
|
|
|
5143.1.1
by Jelmer Vernooij
Add separate tests for BzrDirs with colocated branch support and |
22 |
have the test_unsupported tests run; the others have the test_supported tests
|
23 |
run.
|
|
24 |
"""
|
|
25 |
||
|
5363.2.3
by Jelmer Vernooij
Add ControlDirFormat. |
26 |
from bzrlib.controldir import ControlDirFormat |
|
5143.1.1
by Jelmer Vernooij
Add separate tests for BzrDirs with colocated branch support and |
27 |
from bzrlib.tests import ( |
28 |
default_transport, |
|
29 |
multiply_tests, |
|
30 |
)
|
|
|
5363.2.2
by Jelmer Vernooij
Rename per_bzrdir => per_controldir. |
31 |
from bzrlib.tests.per_controldir import ( |
|
5363.2.18
by Jelmer Vernooij
Rename TestCaseWithBzrDir -> TestCaseWithControlDir. |
32 |
TestCaseWithControlDir, |
|
5143.1.1
by Jelmer Vernooij
Add separate tests for BzrDirs with colocated branch support and |
33 |
make_scenarios, |
34 |
)
|
|
35 |
||
36 |
||
37 |
def load_tests(standard_tests, module, loader): |
|
38 |
colo_supported_formats = [] |
|
39 |
colo_unsupported_formats = [] |
|
|
5363.2.3
by Jelmer Vernooij
Add ControlDirFormat. |
40 |
for format in ControlDirFormat.known_formats(): |
|
5143.1.1
by Jelmer Vernooij
Add separate tests for BzrDirs with colocated branch support and |
41 |
if format.colocated_branches: |
42 |
colo_supported_formats.append(format) |
|
43 |
else: |
|
44 |
colo_unsupported_formats.append(format) |
|
45 |
supported_scenarios = make_scenarios(default_transport, None, None, |
|
46 |
colo_supported_formats) |
|
47 |
unsupported_scenarios = make_scenarios(default_transport, None, None, |
|
48 |
colo_unsupported_formats) |
|
49 |
result = loader.suiteClass() |
|
50 |
supported_tests = loader.loadTestsFromModuleNames([ |
|
|
5363.2.2
by Jelmer Vernooij
Rename per_bzrdir => per_controldir. |
51 |
'bzrlib.tests.per_controldir_colo.test_supported']) |
|
5143.1.1
by Jelmer Vernooij
Add separate tests for BzrDirs with colocated branch support and |
52 |
unsupported_tests = loader.loadTestsFromModuleNames([ |
|
5363.2.2
by Jelmer Vernooij
Rename per_bzrdir => per_controldir. |
53 |
'bzrlib.tests.per_controldir_colo.test_unsupported']) |
|
5143.1.1
by Jelmer Vernooij
Add separate tests for BzrDirs with colocated branch support and |
54 |
multiply_tests(supported_tests, supported_scenarios, result) |
55 |
multiply_tests(unsupported_tests, unsupported_scenarios, result) |
|
56 |
return result |