~bzr/bzr/bzr.1.5

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-05-08 23:03:13 UTC
  • mfrom: (3394.3.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20080508230313-knn3ibom6wt27w5k
(vila) Make the test suite use the new test loader

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from bzrlib.tests import (
28
28
                          adapt_modules,
29
29
                          default_transport,
30
 
                          TestLoader,
31
30
                          TestScenarioApplier,
32
 
                          TestSuite,
33
31
                          )
34
32
from bzrlib.tests.bzrdir_implementations.test_bzrdir import TestCaseWithBzrDir
35
33
from bzrlib.workingtree import (WorkingTreeFormat,
50
48
        self._transport_server = transport_server
51
49
        self._transport_readonly_server = transport_readonly_server
52
50
        self.scenarios = self.formats_to_scenarios(formats)
53
 
    
 
51
 
54
52
    def formats_to_scenarios(self, formats):
55
53
        """Transform the input formats to a list of scenarios.
56
54
 
57
55
        :param formats: A list of (workingtree_format, bzrdir_format).
58
56
        """
59
 
    
 
57
 
60
58
        result = []
61
59
        for workingtree_format, bzrdir_format in formats:
62
60
            result.append(self.create_scenario(workingtree_format,
89
87
        return self.workingtree_format.initialize(made_control)
90
88
 
91
89
 
92
 
def test_suite():
93
 
    result = TestSuite()
 
90
def load_tests(basic_tests, module, loader):
 
91
    result = loader.suiteClass()
 
92
    # add the tests for this module
 
93
    result.addTests(basic_tests)
 
94
 
94
95
    test_workingtree_implementations = [
95
96
        'bzrlib.tests.workingtree_implementations.test_add_reference',
96
97
        'bzrlib.tests.workingtree_implementations.test_add',
127
128
        'bzrlib.tests.workingtree_implementations.test_walkdirs',
128
129
        'bzrlib.tests.workingtree_implementations.test_workingtree',
129
130
        ]
 
131
 
130
132
    adapter = WorkingTreeTestProviderAdapter(
131
133
        default_transport,
132
134
        # None here will cause a readonly decorator to be created
133
135
        # by the TestCaseWithTransport.get_readonly_transport method.
134
136
        None,
135
 
        [(format, format._matchingbzrdir) for format in 
 
137
        [(format, format._matchingbzrdir) for format in
136
138
         WorkingTreeFormat._formats.values() + _legacy_formats])
137
 
    loader = TestLoader()
 
139
 
 
140
    # add the tests for the sub modules
138
141
    adapt_modules(test_workingtree_implementations, adapter, loader, result)
139
142
    return result