~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-04-17 00:59:30 UTC
  • mfrom: (1551.15.4 Aaron's mergeable stuff)
  • Revision ID: pqm@pqm.ubuntu.com-20070417005930-rofskshyjsfzrahh
Fix ftp transport with servers that don't support atomic rename

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_detailed, StraceResult
 
23
from bzrlib.strace import StraceFeature, strace, 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_detailed(function, ["a", "b"], {"c": "c"},
55
 
                        follow_children=False)
 
54
        strace(function, "a", "b", c="c")
56
55
        self.assertEqual([("a", ("b",), {"c":"c"})], output)
57
56
 
58
57
    def test_strace_callable_result(self):
59
58
        def function():
60
59
            return "foo"
61
 
        result, strace_result = strace_detailed(function,[], {},
62
 
                                                follow_children=False)
 
60
        result, strace_result = strace(function)
63
61
        self.assertEqual("foo", result)
64
62
        self.assertIsInstance(strace_result, StraceResult)
65
63
 
67
65
        """Checks that a reasonable raw strace log was found by strace."""
68
66
        def function():
69
67
            self.build_tree(['myfile'])
70
 
        unused, result = strace_detailed(function, [], {},
71
 
                                         follow_children=False)
 
68
        _, result = strace(function)
72
69
        self.assertContainsRe(result.raw_log, 'myfile')