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

  • Committer: Robert Collins
  • Date: 2009-03-07 06:58:17 UTC
  • mto: This revision was merged to the branch mainline in revision 4098.
  • Revision ID: robertc@robertcollins.net-20090307065817-btjngdy1cvv4nwfo
Bulk update all test adaptation into a single approach, using multiply_tests rather than test adapters.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    SuccessfulSmartServerResponse,
49
49
    )
50
50
from bzrlib.tests import (
51
 
    iter_suite_tests,
52
51
    split_suite_by_re,
53
 
    TestScenarioApplier,
54
52
    )
55
53
from bzrlib.transport import chroot, get_transport
56
54
from bzrlib.util import bencode
60
58
    """Multiply tests version and protocol consistency."""
61
59
    # FindRepository tests.
62
60
    bzrdir_mod = bzrlib.smart.bzrdir
63
 
    applier = TestScenarioApplier()
64
 
    applier.scenarios = [
 
61
    scenarios = [
65
62
        ("find_repository", {
66
63
            "_request_class":bzrdir_mod.SmartServerRequestFindRepositoryV1}),
67
64
        ("find_repositoryV2", {
73
70
        "TestSmartServerRequestFindRepository")
74
71
    v2_only, v1_and_2 = split_suite_by_re(to_adapt,
75
72
        "_v2")
76
 
    for test in iter_suite_tests(v1_and_2):
77
 
        result.addTests(applier.adapt(test))
78
 
    del applier.scenarios[0]
79
 
    for test in iter_suite_tests(v2_only):
80
 
        result.addTests(applier.adapt(test))
 
73
    tests.multiply_tests(v1_and_2, scenarios, result)
 
74
    # The first scenario is only applicable to v1 protocols, it is deleted
 
75
    # since.
 
76
    tests.multiply_tests(v2_only, scenarios[1:], result)
81
77
    return result
82
78
 
83
79