~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_selftest.py

  • Committer: Martin Pool
  • Date: 2010-02-25 06:17:27 UTC
  • mfrom: (5055 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5057.
  • Revision ID: mbp@sourcefrog.net-20100225061727-4sd9lt0qmdc6087t
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2007 Canonical Ltd
 
1
# Copyright (C) 2006-2010 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
20
19
from bzrlib import (
21
20
    benchmarks,
22
21
    tests,
23
22
    )
24
 
from bzrlib.errors import ParamikoNotPresent
25
23
from bzrlib.tests import (
26
 
                          features,
27
 
                          TestCase,
28
 
                          TestCaseInTempDir,
29
 
                          TestSkipped,
30
 
                          )
31
 
 
 
24
    features,
 
25
    stub_sftp,
 
26
    )
 
27
from bzrlib.transport import memory
32
28
 
33
29
class SelfTestPatch:
34
30
 
51
47
            tests.selftest = original_selftest
52
48
 
53
49
 
54
 
class TestOptionsWritingToDisk(TestCaseInTempDir, SelfTestPatch):
 
50
class TestOptionsWritingToDisk(tests.TestCaseInTempDir, SelfTestPatch):
55
51
 
56
52
    def test_benchmark_runs_benchmark_tests(self):
57
53
        """selftest --benchmark should change the suite factory."""
69
65
        self.assertEqual(0, len(lines))
70
66
 
71
67
 
72
 
class TestOptions(TestCase, SelfTestPatch):
 
68
class TestOptions(tests.TestCase, SelfTestPatch):
73
69
 
74
70
    def test_load_list(self):
75
71
        params = self.get_params_passed_to_core('selftest --load-list foo')
80
76
        # version.
81
77
        self.requireFeature(features.paramiko)
82
78
        params = self.get_params_passed_to_core('selftest --transport=sftp')
83
 
        self.assertEqual(bzrlib.transport.sftp.SFTPAbsoluteServer,
 
79
        self.assertEqual(stub_sftp.SFTPAbsoluteServer,
84
80
            params[1]["transport"])
85
81
 
86
82
    def test_transport_set_to_memory(self):
87
83
        # Test that we can pass a transport to the selftest core - memory
88
84
        # version.
89
 
        import bzrlib.transport.memory
90
85
        params = self.get_params_passed_to_core('selftest --transport=memory')
91
 
        self.assertEqual(bzrlib.transport.memory.MemoryServer,
92
 
            params[1]["transport"])
 
86
        self.assertEqual(memory.MemoryServer, params[1]["transport"])
93
87
 
94
88
    def test_parameters_passed_to_core(self):
95
89
        params = self.get_params_passed_to_core('selftest --list-only')