mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-14 16:59:45 +00:00
avoid argument collision in call of start_action in eliotutil
Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
This commit is contained in:
parent
424047ba43
commit
759d4c85a2
@ -312,7 +312,7 @@ class LogCallDeferredTests(TestCase):
|
||||
return base ** exp
|
||||
self.assertThat(f(exp=2,base=10), succeeded(Equals(100)))
|
||||
msg = logger.messages[0]
|
||||
assertContainsFields(self, msg, {"base": 10, "exp": 2})
|
||||
assertContainsFields(self, msg, {"kwargs": {"base": 10, "exp": 2}})
|
||||
|
||||
|
||||
@capture_logging(
|
||||
@ -328,4 +328,5 @@ class LogCallDeferredTests(TestCase):
|
||||
return base ** exp
|
||||
self.assertThat(f(10, 2, message="an exponential function"), succeeded(Equals(100)))
|
||||
msg = logger.messages[0]
|
||||
assertContainsFields(self, msg, {"args": (10, 2), "message": "an exponential function"})
|
||||
assertContainsFields(self, msg, {"args": (10, 2)})
|
||||
assertContainsFields(self, msg, {"kwargs": {"message": "an exponential function"}})
|
||||
|
@ -121,7 +121,7 @@ class TestStreamingLogs(AsyncTestCase):
|
||||
|
||||
self.assertThat(len(messages), Equals(3))
|
||||
self.assertThat(messages[0]["action_type"], Equals("test:cli:some-exciting-action"))
|
||||
self.assertThat(messages[0]["arguments"],
|
||||
self.assertThat(messages[0]["kwargs"]["arguments"],
|
||||
Equals(["hello", "good-\\xff-day", 123, {"a": 35}, [None]]))
|
||||
self.assertThat(messages[1]["action_type"], Equals("test:cli:some-exciting-action"))
|
||||
self.assertThat("started", Equals(messages[0]["action_status"]))
|
||||
|
@ -325,7 +325,7 @@ def log_call_deferred(action_type):
|
||||
# Use the action's context method to avoid ending the action when
|
||||
# the `with` block ends.
|
||||
kwargs = {k: bytes_to_unicode(True, kw[k]) for k in kw}
|
||||
with start_action(action_type=action_type, args=a, **kwargs).context():
|
||||
with start_action(action_type=action_type, args=a, kwargs=kwargs).context():
|
||||
# Use addActionFinish so that the action finishes when the
|
||||
# Deferred fires.
|
||||
d = maybeDeferred(f, *a, **kw)
|
||||
|
Loading…
Reference in New Issue
Block a user