~bzr/ubuntu/lucid/bzr/beta-ppa

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_bzrdir_colo/__init__.py

  • Committer: Martin Pool
  • Date: 2010-08-18 04:26:39 UTC
  • mfrom: (129.1.8 packaging-karmic)
  • Revision ID: mbp@sourcefrog.net-20100818042639-mjoxtngyjwiu05fo
* PPA rebuild for lucid.
* PPA rebuild for karmic.
* PPA rebuild onto jaunty.
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
18
"""BzrDir implementation tests for colocated branch support.
 
19
 
 
20
These tests check the conformance of the colocated branches support.
 
21
All bzrdir formats are tested - those that do not suppport colocated branches 
 
22
have the test_unsupported tests run; the others have the test_supported tests
 
23
run.
 
24
"""
 
25
 
 
26
from bzrlib.bzrdir import BzrDirFormat
 
27
from bzrlib.tests import (
 
28
    default_transport,
 
29
    multiply_tests,
 
30
    )
 
31
from bzrlib.tests.per_bzrdir import (
 
32
    TestCaseWithBzrDir,
 
33
    make_scenarios,
 
34
    )
 
35
 
 
36
 
 
37
def load_tests(standard_tests, module, loader):
 
38
    colo_supported_formats = []
 
39
    colo_unsupported_formats = []
 
40
    for format in BzrDirFormat.known_formats():
 
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([
 
51
        'bzrlib.tests.per_bzrdir_colo.test_supported'])
 
52
    unsupported_tests = loader.loadTestsFromModuleNames([
 
53
        'bzrlib.tests.per_bzrdir_colo.test_unsupported'])
 
54
    multiply_tests(supported_tests, supported_scenarios, result)
 
55
    multiply_tests(unsupported_tests, unsupported_scenarios, result)
 
56
    return result