~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-09-01 08:02:42 UTC
  • mfrom: (5390.3.3 faster-revert-593560)
  • Revision ID: pqm@pqm.ubuntu.com-20100901080242-esg62ody4frwmy66
(spiv) Avoid repeatedly calling self.target.all_file_ids() in
 InterTree.iter_changes. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
208
208
    def test_scenarios(self):
209
209
        # check that constructor parameters are passed through to the adapted
210
210
        # test.
211
 
        from bzrlib.tests.per_bzrdir import make_scenarios
 
211
        from bzrlib.tests.per_controldir import make_scenarios
212
212
        vfs_factory = "v"
213
213
        server1 = "a"
214
214
        server2 = "b"
801
801
        self.requireFeature(test_lsprof.LSProfFeature)
802
802
        result_stream = StringIO()
803
803
        result = bzrlib.tests.VerboseTestResult(
804
 
            unittest._WritelnDecorator(result_stream),
 
804
            result_stream,
805
805
            descriptions=0,
806
806
            verbosity=2,
807
807
            )
862
862
        # verbose test output formatting
863
863
        result_stream = StringIO()
864
864
        result = bzrlib.tests.VerboseTestResult(
865
 
            unittest._WritelnDecorator(result_stream),
 
865
            result_stream,
866
866
            descriptions=0,
867
867
            verbosity=2,
868
868
            )
878
878
        output = result_stream.getvalue()[prefix:]
879
879
        lines = output.splitlines()
880
880
        self.assertContainsRe(lines[0], r'XFAIL *\d+ms$')
 
881
        if sys.version_info > (2, 7):
 
882
            self.expectFailure("_ExpectedFailure on 2.7 loses the message",
 
883
                self.assertNotEqual, lines[1], '    ')
881
884
        self.assertEqual(lines[1], '    foo')
882
885
        self.assertEqual(2, len(lines))
883
886
 
917
920
        # verbose test output formatting
918
921
        result_stream = StringIO()
919
922
        result = bzrlib.tests.VerboseTestResult(
920
 
            unittest._WritelnDecorator(result_stream),
 
923
            result_stream,
921
924
            descriptions=0,
922
925
            verbosity=2,
923
926
            )
1419
1422
        sample_test = TestTestCase("method_that_times_a_bit_twice")
1420
1423
        output_stream = StringIO()
1421
1424
        result = bzrlib.tests.VerboseTestResult(
1422
 
            unittest._WritelnDecorator(output_stream),
 
1425
            output_stream,
1423
1426
            descriptions=0,
1424
1427
            verbosity=2)
1425
1428
        sample_test.run(result)
2337
2340
            os.chdir = orig_chdir
2338
2341
        self.assertEqual(['foo', 'current'], chdirs)
2339
2342
 
 
2343
    def test_get_bzr_path_with_cwd_bzrlib(self):
 
2344
        self.get_source_path = lambda: ""
 
2345
        self.overrideAttr(os.path, "isfile", lambda path: True)
 
2346
        self.assertEqual(self.get_bzr_path(), "bzr")
 
2347
 
2340
2348
 
2341
2349
class TestActuallyStartBzrSubprocess(tests.TestCaseWithTransport):
2342
2350
    """Tests that really need to do things with an external bzr."""