~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Upgraded to the latest bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
                          TestLoader,
32
32
                          TestSuite,
33
33
                          )
 
34
from bzrlib.transport.memory import MemoryServer
34
35
 
35
36
 
36
37
def test_suite():
41
42
    formats = BzrDirFormat.known_formats()
42
43
    adapter = BzrDirTestProviderAdapter(
43
44
        default_transport,
 
45
        None,
44
46
        # None here will cause a readonly decorator to be created
45
47
        # by the TestCaseWithTransport.get_readonly_transport method.
46
48
        None,
47
49
        formats)
48
50
    loader = TestLoader()
49
51
    adapt_modules(test_bzrdir_implementations, adapter, loader, result)
 
52
 
 
53
    # This will always add the tests for smart server transport, regardless of
 
54
    # the --transport option the user specified to 'bzr selftest'.
 
55
    from bzrlib.smart.server import SmartTCPServer_for_testing, ReadonlySmartTCPServer_for_testing
 
56
    from bzrlib.remote import RemoteBzrDirFormat
 
57
 
 
58
    # test the remote server behaviour using a MemoryTransport
 
59
    smart_server_suite = TestSuite()
 
60
    adapt_to_smart_server = BzrDirTestProviderAdapter(
 
61
        MemoryServer,
 
62
        SmartTCPServer_for_testing,
 
63
        ReadonlySmartTCPServer_for_testing,
 
64
        [(RemoteBzrDirFormat())])
 
65
    adapt_modules(test_bzrdir_implementations,
 
66
                  adapt_to_smart_server,
 
67
                  TestLoader(),
 
68
                  smart_server_suite)
 
69
    result.addTests(smart_server_suite)
 
70
 
50
71
    return result