~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_strace.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-07-04 14:02:09 UTC
  • mfrom: (2584.1.1 Aaron's integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070704140209-ldl1njlpcclszadu
Fix #102019 by not asking strace to follow children

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import errno
21
21
import subprocess
22
22
 
23
 
from bzrlib.strace import StraceFeature, strace, StraceResult
 
23
from bzrlib.strace import StraceFeature, strace_detailed, StraceResult
24
24
from bzrlib.tests import TestCaseWithTransport
25
25
 
26
26
 
51
51
        output = []
52
52
        def function(positional, *args, **kwargs):
53
53
            output.append((positional, args, kwargs))
54
 
        strace(function, "a", "b", c="c")
 
54
        strace_detailed(function, ["a", "b"], {"c": "c"},
 
55
                        follow_children=False)
55
56
        self.assertEqual([("a", ("b",), {"c":"c"})], output)
56
57
 
57
58
    def test_strace_callable_result(self):
58
59
        def function():
59
60
            return "foo"
60
 
        result, strace_result = strace(function)
 
61
        result, strace_result = strace_detailed(function,[], {},
 
62
                                                follow_children=False)
61
63
        self.assertEqual("foo", result)
62
64
        self.assertIsInstance(strace_result, StraceResult)
63
65
 
65
67
        """Checks that a reasonable raw strace log was found by strace."""
66
68
        def function():
67
69
            self.build_tree(['myfile'])
68
 
        _, result = strace(function)
 
70
        unused, result = strace_detailed(function, [], {},
 
71
                                         follow_children=False)
69
72
        self.assertContainsRe(result.raw_log, 'myfile')