~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2010-02-17 17:11:16 UTC
  • mfrom: (4797.2.17 2.1)
  • mto: (4797.2.18 2.1)
  • mto: This revision was merged to the branch mainline in revision 5055.
  • Revision ID: john@arbash-meinel.com-20100217171116-h7t9223ystbnx5h8
merge bzr.2.1 in preparation for NEWS entry.

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
 
                          SubUnitFeature,
27
 
                          TestCase,
28
 
                          TestCaseInTempDir,
29
 
                          TestSkipped,
30
 
                          )
 
24
    features,
 
25
    stub_sftp,
 
26
    )
31
27
 
32
28
 
33
29
class SelfTestPatch:
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')
78
74
    def test_transport_set_to_sftp(self):
79
75
        # Test that we can pass a transport to the selftest core - sftp
80
76
        # version.
81
 
        try:
82
 
            import bzrlib.transport.sftp
83
 
        except ParamikoNotPresent:
84
 
            raise TestSkipped("Paramiko not present")
 
77
        self.requireFeature(features.paramiko)
85
78
        params = self.get_params_passed_to_core('selftest --transport=sftp')
86
 
        self.assertEqual(bzrlib.transport.sftp.SFTPAbsoluteServer,
 
79
        self.assertEqual(stub_sftp.SFTPAbsoluteServer,
87
80
            params[1]["transport"])
88
81
 
89
82
    def test_transport_set_to_memory(self):
116
109
        self.assertEqual(['foo', 'bar'], params[1]['starting_with'])
117
110
 
118
111
    def test_subunit(self):
119
 
        self.requireFeature(SubUnitFeature)
 
112
        self.requireFeature(features.subunit)
120
113
        params = self.get_params_passed_to_core('selftest --subunit')
121
114
        self.assertEqual(tests.SubUnitBzrRunner, params[1]['runner_class'])
122
115