[CalendarServer-changes] [12325] twext/trunk/twext/who/ldap/test/test_util.py
source_changes at macosforge.org
source_changes at macosforge.org
Wed Mar 12 11:17:08 PDT 2014
Revision: 12325
http://trac.calendarserver.org//changeset/12325
Author: wsanchez at apple.com
Date: 2014-01-13 11:02:16 -0800 (Mon, 13 Jan 2014)
Log Message:
-----------
Test matching with unknown match type and with unknown field name.
Modified Paths:
--------------
twext/trunk/twext/who/ldap/test/test_util.py
Modified: twext/trunk/twext/who/ldap/test/test_util.py
===================================================================
--- twext/trunk/twext/who/ldap/test/test_util.py 2014-01-13 18:58:53 UTC (rev 12324)
+++ twext/trunk/twext/who/ldap/test/test_util.py 2014-01-13 19:02:16 UTC (rev 12325)
@@ -145,6 +145,41 @@
self.assertEquals(queryString, expected)
+ def test_queryStringFromMatchExpression_unknownFieldName(self):
+ """
+ Unknown expression.
+ """
+ service = DirectoryService()
+
+ expression = MatchExpression(
+ object(), u"xyzzy",
+ )
+
+ self.assertRaises(
+ QueryNotSupportedError,
+ ldapQueryStringFromMatchExpression,
+ expression, self.attrMap(service)
+ )
+
+
+ def test_queryStringFromMatchExpression_unknownMatchType(self):
+ """
+ Unknown expression.
+ """
+ service = DirectoryService()
+
+ expression = MatchExpression(
+ service.fieldName.shortNames, u"xyzzy",
+ matchType=object()
+ )
+
+ self.assertRaises(
+ QueryNotSupportedError,
+ ldapQueryStringFromMatchExpression,
+ expression, self.attrMap(service)
+ )
+
+
def test_queryStringFromCompoundExpression_single(
self, queryFunction=ldapQueryStringFromCompoundExpression
):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/736d0707/attachment.html>
More information about the calendarserver-changes
mailing list