~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Martin Pool
  • Date: 2010-04-27 07:29:11 UTC
  • mto: This revision was merged to the branch mainline in revision 5295.
  • Revision ID: mbp@sourcefrog.net-20100427072911-hagcu863rqbu4mal
Add simple test case for ObjectWithCleanups

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
    )
63
63
from bzrlib.tests import (
64
64
    features,
 
65
    stub_sftp,
65
66
    test_lsprof,
66
67
    test_server,
67
68
    test_sftp_transport,
1946
1947
 
1947
1948
    def test_transport_sftp(self):
1948
1949
        self.requireFeature(features.paramiko)
1949
 
        from bzrlib.tests import stub_sftp
1950
1950
        self.check_transport_set(stub_sftp.SFTPAbsoluteServer)
1951
1951
 
1952
1952
    def test_transport_memory(self):
2773
2773
        # Test that a plausible list of modules to doctest is returned
2774
2774
        # by _test_suite_modules_to_doctest.
2775
2775
        test_list = tests._test_suite_modules_to_doctest()
2776
 
        if __doc__ is None:
2777
 
            # When docstrings are stripped, there are no modules to doctest
2778
 
            self.assertEqual([], test_list)
2779
 
            return
2780
2776
        self.assertSubset([
2781
2777
            'bzrlib.timestamp',
2782
2778
            ],
2799
2795
        self.overrideAttr(tests, '_test_suite_testmod_names', testmod_names)
2800
2796
        def doctests():
2801
2797
            calls.append("modules_to_doctest")
2802
 
            if __doc__ is None:
2803
 
                return []
2804
2798
            return ['bzrlib.timestamp']
2805
2799
        self.overrideAttr(tests, '_test_suite_modules_to_doctest', doctests)
2806
2800
        expected_test_list = [
2809
2803
            ('bzrlib.tests.per_transport.TransportTests'
2810
2804
             '.test_abspath(LocalTransport,LocalURLServer)'),
2811
2805
            'bzrlib.tests.test_selftest.TestTestSuite.test_test_suite',
 
2806
            # modules_to_doctest
 
2807
            'bzrlib.timestamp.format_highres_date',
2812
2808
            # plugins can't be tested that way since selftest may be run with
2813
2809
            # --no-plugins
2814
2810
            ]
2815
 
        if __doc__ is not None:
2816
 
            expected_test_list.extend([
2817
 
                # modules_to_doctest
2818
 
                'bzrlib.timestamp.format_highres_date',
2819
 
                ])
2820
2811
        suite = tests.test_suite()
2821
2812
        self.assertEqual(set(["testmod_names", "modules_to_doctest"]),
2822
2813
            set(calls))