/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/blackbox/test_selftest.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-12-22 18:18:20 UTC
  • mfrom: (4913.2.26 2.1.0rc1-module-available)
  • Revision ID: pqm@pqm.ubuntu.com-20091222181820-qfolh2sy2nevoxxj
(jam) Switch many test features over to ModuleAvailable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
16
16
 
17
17
"""UI tests for the test framework."""
18
18
 
 
19
import bzrlib.transport
19
20
from bzrlib import (
20
21
    benchmarks,
21
22
    tests,
22
23
    )
 
24
from bzrlib.errors import ParamikoNotPresent
23
25
from bzrlib.tests import (
24
 
    features,
25
 
    )
26
 
from bzrlib.transport import memory
 
26
                          features,
 
27
                          TestCase,
 
28
                          TestCaseInTempDir,
 
29
                          TestSkipped,
 
30
                          )
 
31
 
27
32
 
28
33
class SelfTestPatch:
29
34
 
46
51
            tests.selftest = original_selftest
47
52
 
48
53
 
49
 
class TestOptionsWritingToDisk(tests.TestCaseInTempDir, SelfTestPatch):
 
54
class TestOptionsWritingToDisk(TestCaseInTempDir, SelfTestPatch):
50
55
 
51
56
    def test_benchmark_runs_benchmark_tests(self):
52
57
        """selftest --benchmark should change the suite factory."""
64
69
        self.assertEqual(0, len(lines))
65
70
 
66
71
 
67
 
class TestOptions(tests.TestCase, SelfTestPatch):
 
72
class TestOptions(TestCase, SelfTestPatch):
68
73
 
69
74
    def test_load_list(self):
70
75
        params = self.get_params_passed_to_core('selftest --load-list foo')
74
79
        # Test that we can pass a transport to the selftest core - sftp
75
80
        # version.
76
81
        self.requireFeature(features.paramiko)
77
 
        from bzrlib.tests import stub_sftp
78
82
        params = self.get_params_passed_to_core('selftest --transport=sftp')
79
 
        self.assertEqual(stub_sftp.SFTPAbsoluteServer,
 
83
        self.assertEqual(bzrlib.transport.sftp.SFTPAbsoluteServer,
80
84
            params[1]["transport"])
81
85
 
82
86
    def test_transport_set_to_memory(self):
83
87
        # Test that we can pass a transport to the selftest core - memory
84
88
        # version.
 
89
        import bzrlib.transport.memory
85
90
        params = self.get_params_passed_to_core('selftest --transport=memory')
86
 
        self.assertEqual(memory.MemoryServer, params[1]["transport"])
 
91
        self.assertEqual(bzrlib.transport.memory.MemoryServer,
 
92
            params[1]["transport"])
87
93
 
88
94
    def test_parameters_passed_to_core(self):
89
95
        params = self.get_params_passed_to_core('selftest --list-only')