[CalendarServer-changes] [12339] twext/trunk/twext/who
source_changes at macosforge.org
source_changes at macosforge.org
Wed Mar 12 11:22:43 PDT 2014
Revision: 12339
http://trac.calendarserver.org//changeset/12339
Author: wsanchez at apple.com
Date: 2014-01-14 13:18:37 -0800 (Tue, 14 Jan 2014)
Log Message:
-----------
LDAP raises for unknown record types; XML yields no results.
Modified Paths:
--------------
twext/trunk/twext/who/ldap/test/test_service.py
twext/trunk/twext/who/test/test_xml.py
Modified: twext/trunk/twext/who/ldap/test/test_service.py
===================================================================
--- twext/trunk/twext/who/ldap/test/test_service.py 2014-01-14 21:18:02 UTC (rev 12338)
+++ twext/trunk/twext/who/ldap/test/test_service.py 2014-01-14 21:18:37 UTC (rev 12339)
@@ -29,7 +29,7 @@
from twisted.cred.credentials import UsernamePassword
from twisted.trial import unittest
-from ...idirectory import FieldName as BaseFieldName
+from ...idirectory import QueryNotSupportedError, FieldName as BaseFieldName
# from ...expression import (
# CompoundExpression, Operand, MatchExpression, MatchType, MatchFlags
# )
@@ -84,16 +84,16 @@
class DirectoryServiceConvenienceTestMixIn(
BaseDirectoryServiceConvenienceTestMixIn
):
- def test_recordsWithRecordType(self):
- return (
- BaseDirectoryServiceConvenienceTestMixIn
- .test_recordsWithRecordType(self)
+ def test_recordsWithRecordType_unknown(self):
+ service = self.service()
+
+ self.assertRaises(
+ QueryNotSupportedError,
+ service.recordsWithRecordType, object()
)
- test_recordsWithRecordType.todo = "needs a seed?"
-
class DirectoryServiceConnectionTestMixIn(object):
@inlineCallbacks
def test_connect_defaults(self):
Modified: twext/trunk/twext/who/test/test_xml.py
===================================================================
--- twext/trunk/twext/who/test/test_xml.py 2014-01-14 21:18:02 UTC (rev 12338)
+++ twext/trunk/twext/who/test/test_xml.py 2014-01-14 21:18:37 UTC (rev 12339)
@@ -85,12 +85,17 @@
@inlineCallbacks
- def test_recordsWithRecordType(self):
+ def test_recordsWithRecordType_unknown(self):
service = self.service()
records = (yield service.recordsWithRecordType(object()))
self.assertEquals(set(records), set())
+
+ @inlineCallbacks
+ def test_recordsWithRecordType(self):
+ service = self.service()
+
records = (
yield service.recordsWithRecordType(service.recordType.user)
)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/317a6dc1/attachment.html>
More information about the calendarserver-changes
mailing list