[CalendarServer-changes] [11699] CalendarServer/branches/users/glyph/log-cleanups/twext/python/test/ test_log.py
source_changes at macosforge.org
source_changes at macosforge.org
Tue Sep 17 16:02:17 PDT 2013
Revision: 11699
http://trac.calendarserver.org//changeset/11699
Author: glyph at apple.com
Date: 2013-09-17 16:02:16 -0700 (Tue, 17 Sep 2013)
Log Message:
-----------
coding standard; 5-space indents
Modified Paths:
--------------
CalendarServer/branches/users/glyph/log-cleanups/twext/python/test/test_log.py
Modified: CalendarServer/branches/users/glyph/log-cleanups/twext/python/test/test_log.py
===================================================================
--- CalendarServer/branches/users/glyph/log-cleanups/twext/python/test/test_log.py 2013-09-17 23:02:16 UTC (rev 11698)
+++ CalendarServer/branches/users/glyph/log-cleanups/twext/python/test/test_log.py 2013-09-17 23:02:16 UTC (rev 11699)
@@ -289,53 +289,50 @@
def test_formatUnformattableEventWithUnformattableKey(self):
- """
- Formatting an unformattable event that has an unformattable key.
- """
- event = {
- "log_format": "{evil()}",
- "evil": lambda: 1/0,
- Gurk(): "gurk",
- }
- result = formatEvent(event)
+ """
+ Formatting an unformattable event that has an unformattable key.
+ """
+ event = {
+ "log_format": "{evil()}",
+ "evil": lambda: 1/0,
+ Gurk(): "gurk",
+ }
+ result = formatEvent(event)
+ self.assertIn("MESSAGE LOST: unformattable object logged:", result)
+ self.assertIn("Recoverable data:", result)
+ self.assertIn("Exception during formatting:", result)
- self.assertIn("MESSAGE LOST: unformattable object logged:", result)
- self.assertIn("Recoverable data:", result)
- self.assertIn("Exception during formatting:", result)
-
def test_formatUnformattableEventWithUnformattableValue(self):
- """
- Formatting an unformattable event that has an unformattable value.
- """
- event = dict(
- log_format="{evil()}",
- evil=lambda: 1/0,
- gurk=Gurk(),
- )
- result = formatEvent(event)
+ """
+ Formatting an unformattable event that has an unformattable value.
+ """
+ event = dict(
+ log_format="{evil()}",
+ evil=lambda: 1/0,
+ gurk=Gurk(),
+ )
+ result = formatEvent(event)
+ self.assertIn("MESSAGE LOST: unformattable object logged:", result)
+ self.assertIn("Recoverable data:", result)
+ self.assertIn("Exception during formatting:", result)
- self.assertIn("MESSAGE LOST: unformattable object logged:", result)
- self.assertIn("Recoverable data:", result)
- self.assertIn("Exception during formatting:", result)
-
def test_formatUnformattableEventWithUnformattableErrorOMGWillItStop(self):
- """
- Formatting an unformattable event that has an unformattable value.
- """
- event = dict(
- log_format="{evil()}",
- evil=lambda: 1/0,
- )
+ """
+ Formatting an unformattable event that has an unformattable value.
+ """
+ event = dict(
+ log_format="{evil()}",
+ evil=lambda: 1/0,
+ )
+ # Call formatUnformattableEvent() directly with a bogus exception.
+ result = formatUnformattableEvent(event, Gurk())
+ self.assertIn("MESSAGE LOST: unable to recover any data from message:",
+ result)
- # Call formatUnformattableEvent() directly with a bogus exception.
- result = formatUnformattableEvent(event, Gurk())
- self.assertIn("MESSAGE LOST: unable to recover any data from message:", result)
-
-
class LoggerTests(SetUpTearDown, unittest.TestCase):
"""
Tests for L{Logger}.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130917/3a68f47c/attachment-0001.html>
More information about the calendarserver-changes
mailing list