/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_strace.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-17 00:47:52 UTC
  • mfrom: (7182 work)
  • mto: This revision was merged to the branch mainline in revision 7305.
  • Revision ID: jelmer@jelmer.uk-20181117004752-6ywampe5pfywlby4
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
        # strace itself is fixed (bug #103133), we can get rid of the
50
50
        # restriction.
51
51
        active = threading.activeCount()
52
 
        if active > 1: # There is always the main thread at least
 
52
        if active > 1:  # There is always the main thread at least
53
53
            self.knownFailure(
54
54
                '%d active threads, bug #103133 needs to be fixed.' % active)
55
55
 
68
68
        self._check_threads()
69
69
 
70
70
        output = []
 
71
 
71
72
        def function(positional, *args, **kwargs):
72
73
            output.append((positional, args, kwargs))
73
74
        self.strace_detailed_or_skip(
74
75
            function, ["a", "b"], {"c": "c"},
75
76
            follow_children=False)
76
 
        self.assertEqual([("a", ("b",), {"c":"c"})], output)
 
77
        self.assertEqual([("a", ("b",), {"c": "c"})], output)
77
78
 
78
79
    def test_strace_callable_result(self):
79
80
        self._check_threads()
81
82
        def function():
82
83
            return "foo"
83
84
        result, strace_result = self.strace_detailed_or_skip(function, [], {},
84
 
                                                follow_children=False)
 
85
                                                             follow_children=False)
85
86
        self.assertEqual("foo", result)
86
87
        self.assertIsInstance(strace_result, StraceResult)
87
88
 
92
93
        def function():
93
94
            self.build_tree(['myfile'])
94
95
        unused, result = self.strace_detailed_or_skip(function, [], {},
95
 
                                         follow_children=False)
 
96
                                                      follow_children=False)
96
97
        self.assertContainsRe(result.raw_log, 'myfile')