diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-01-17 11:25:11 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-01-17 11:25:11 +0000 |
commit | 11ab2f56f513620d60f107fdfd5c0218cacacc7d (patch) | |
tree | 393f29b8faf5b5aeeae6a683c7fef8d78dfd1dc5 /tests/util/test_logcontext.py | |
parent | Fix 'NoneType' object has no attribute 'writeHeaders' (diff) | |
parent | Merge pull request #2792 from matrix-org/rav/optimise_logging_context (diff) | |
download | synapse-11ab2f56f513620d60f107fdfd5c0218cacacc7d.tar.xz |
Merge branch 'develop' into rav/fix_closed_connection_errors
Diffstat (limited to 'tests/util/test_logcontext.py')
-rw-r--r-- | tests/util/test_logcontext.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/util/test_logcontext.py b/tests/util/test_logcontext.py index e2f7765f49..4850722bc5 100644 --- a/tests/util/test_logcontext.py +++ b/tests/util/test_logcontext.py @@ -12,12 +12,12 @@ class LoggingContextTestCase(unittest.TestCase): def _check_test_key(self, value): self.assertEquals( - LoggingContext.current_context().test_key, value + LoggingContext.current_context().request, value ) def test_with_context(self): with LoggingContext() as context_one: - context_one.test_key = "test" + context_one.request = "test" self._check_test_key("test") @defer.inlineCallbacks @@ -25,14 +25,14 @@ class LoggingContextTestCase(unittest.TestCase): @defer.inlineCallbacks def competing_callback(): with LoggingContext() as competing_context: - competing_context.test_key = "competing" + competing_context.request = "competing" yield sleep(0) self._check_test_key("competing") reactor.callLater(0, competing_callback) with LoggingContext() as context_one: - context_one.test_key = "one" + context_one.request = "one" yield sleep(0) self._check_test_key("one") @@ -43,14 +43,14 @@ class LoggingContextTestCase(unittest.TestCase): @defer.inlineCallbacks def cb(): - context_one.test_key = "one" + context_one.request = "one" yield function() self._check_test_key("one") callback_completed[0] = True with LoggingContext() as context_one: - context_one.test_key = "one" + context_one.request = "one" # fire off function, but don't wait on it. logcontext.preserve_fn(cb)() @@ -107,7 +107,7 @@ class LoggingContextTestCase(unittest.TestCase): sentinel_context = LoggingContext.current_context() with LoggingContext() as context_one: - context_one.test_key = "one" + context_one.request = "one" d1 = logcontext.make_deferred_yieldable(blocking_function()) # make sure that the context was reset by make_deferred_yieldable @@ -124,7 +124,7 @@ class LoggingContextTestCase(unittest.TestCase): argument isn't actually a deferred""" with LoggingContext() as context_one: - context_one.test_key = "one" + context_one.request = "one" d1 = logcontext.make_deferred_yieldable("bum") self._check_test_key("one") |