507
507
# 1 0 ??? ??? ???(sleep)
508
508
# and then repeated but with 'world', rather than 'hello'.
509
509
# this should appear in the output stream of our test result.
510
self.assertContainsRe(result_stream.getvalue(),
511
r"LSProf output for <type 'unicode'>\(\('hello',\), {'errors': 'replace'}\)\n"
512
r" *CallCount *Recursive *Total\(ms\) *Inline\(ms\) *module:lineno\(function\)\n"
513
r"( +1 +0 +0\.\d+ +0\.\d+ +<method 'disable' of '_lsprof\.Profiler' objects>\n)?"
514
r"LSProf output for <type 'unicode'>\(\('world',\), {'errors': 'replace'}\)\n"
515
r" *CallCount *Recursive *Total\(ms\) *Inline\(ms\) *module:lineno\(function\)\n"
516
r"( +1 +0 +0\.\d+ +0\.\d+ +<method 'disable' of '_lsprof\.Profiler' objects>\n)?"
510
output = result_stream.getvalue()
511
self.assertContainsRe(output,
512
r"LSProf output for <type 'unicode'>\(\('hello',\), {'errors': 'replace'}\)")
513
self.assertContainsRe(output,
514
r" *CallCount *Recursive *Total\(ms\) *Inline\(ms\) *module:lineno\(function\)\n")
515
self.assertContainsRe(output,
516
r"( +1 +0 +0\.\d+ +0\.\d+ +<method 'disable' of '_lsprof\.Profiler' objects>\n)?")
517
self.assertContainsRe(output,
518
r"LSProf output for <type 'unicode'>\(\('world',\), {'errors': 'replace'}\)\n")
520
521
class TestRunner(TestCase):
694
695
err = self.run_bzr_subprocess('merge', '--merge-type', 'magic merge',
696
697
self.assertContainsRe(err, 'No known merge type magic merge')
699
def test_run_bzr_error(self):
700
out, err = self.run_bzr_error(['^$'], 'rocks', retcode=0)
701
self.assertEqual(out, 'it sure does!\n')
703
out, err = self.run_bzr_error(["'foobarbaz' is not a versioned file"],
704
'file-id', 'foobarbaz')