[CalendarServer-changes] [12518] twext/trunk/twext/who/test/test_expression.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:21:38 PDT 2014


Revision: 12518
          http://trac.calendarserver.org//changeset/12518
Author:   wsanchez at apple.com
Date:     2014-01-31 14:03:44 -0800 (Fri, 31 Jan 2014)
Log Message:
-----------
Test multiple flags in MatchExpression.__repr__().

Modified Paths:
--------------
    twext/trunk/twext/who/test/test_expression.py

Modified: twext/trunk/twext/who/test/test_expression.py
===================================================================
--- twext/trunk/twext/who/test/test_expression.py	2014-01-31 22:03:14 UTC (rev 12517)
+++ twext/trunk/twext/who/test/test_expression.py	2014-01-31 22:03:44 UTC (rev 12518)
@@ -76,6 +76,9 @@
     """
 
     def test_repr_name(self):
+        """
+        L{MatchExpression.__repr__} emits field name and value.
+        """
         self.assertEquals(
             "<MatchExpression: u'full names' equals u'Wilfredo Sanchez'>",
             repr(MatchExpression(
@@ -85,6 +88,9 @@
         )
 
     def test_repr_type(self):
+        """
+        L{MatchExpression.__repr__} emits match type.
+        """
         self.assertEquals(
             "<MatchExpression: u'full names' contains u'Sanchez'>",
             repr(MatchExpression(
@@ -95,6 +101,9 @@
         )
 
     def test_repr_flags(self):
+        """
+        L{MatchExpression.__repr__} emits flags.
+        """
         self.assertEquals(
             "<MatchExpression: u'full names' starts with u'Wilfredo' (not)>",
             repr(MatchExpression(
@@ -104,3 +113,13 @@
                 flags=MatchFlags.NOT,
             )),
         )
+        self.assertEquals(
+            "<MatchExpression: u'full names' starts with u'Wilfredo' "
+            "(not|case insensitive)>",
+            repr(MatchExpression(
+                FieldName.fullNames,
+                u"Wilfredo",
+                matchType=MatchType.startsWith,
+                flags=(MatchFlags.NOT | MatchFlags.caseInsensitive),
+            )),
+        )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/cff9385d/attachment.html>


More information about the calendarserver-changes mailing list