<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[12087] CalendarServer/trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/12087">12087</a></dd>
<dt>Author</dt> <dd>sagen@apple.com</dd>
<dt>Date</dt> <dd>2013-12-13 13:51:30 -0800 (Fri, 13 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>LDAP support for structured locations</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkconfcaldavdtestplist">CalendarServer/trunk/conf/caldavd-test.plist</a></li>
<li><a href="#CalendarServertrunktwistedcaldavdirectoryldapdirectorypy">CalendarServer/trunk/twistedcaldav/directory/ldapdirectory.py</a></li>
<li><a href="#CalendarServertrunktwistedcaldavdirectorytesttest_ldapdirectorypy">CalendarServer/trunk/twistedcaldav/directory/test/test_ldapdirectory.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkconfcaldavdtestplist"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/conf/caldavd-test.plist (12086 => 12087)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/conf/caldavd-test.plist        2013-12-13 18:21:26 UTC (rev 12086)
+++ CalendarServer/trunk/conf/caldavd-test.plist        2013-12-13 21:51:30 UTC (rev 12087)
</span><span class="lines">@@ -284,29 +284,20 @@
</span><span class="cx"> <string>mail</string>
</span><span class="cx"> <string>mailAlias</string>
</span><span class="cx"> </array>
</span><del>- <key>firstName</key>
- <string></string>
- <key>lastName</key>
- <string></string>
</del><span class="cx"> </dict>
</span><span class="cx"> </dict>
</span><span class="cx"> <key>locations</key>
</span><span class="cx"> <dict>
</span><span class="cx"> <key>rdn</key>
</span><span class="cx"> <string>ou=locations</string>
</span><ins>+ <key>associatedAddressAttr</key>
+ <string></string>
</ins><span class="cx"> <key>mapping</key>
</span><span class="cx"> <dict>
</span><span class="cx"> <key>recordName</key>
</span><span class="cx"> <string>cn</string>
</span><span class="cx"> <key>fullName</key>
</span><span class="cx"> <string>cn</string>
</span><del>- <key>emailAddresses</key>
- <array>
- </array>
- <key>firstName</key>
- <string></string>
- <key>lastName</key>
- <string></string>
</del><span class="cx"> </dict>
</span><span class="cx"> </dict>
</span><span class="cx"> <key>resources</key>
</span><span class="lines">@@ -319,15 +310,24 @@
</span><span class="cx"> <string>cn</string>
</span><span class="cx"> <key>fullName</key>
</span><span class="cx"> <string>cn</string>
</span><del>- <key>emailAddresses</key>
- <array>
- </array>
- <key>firstName</key>
- <string></string>
- <key>lastName</key>
- <string></string>
</del><span class="cx"> </dict>
</span><span class="cx"> </dict>
</span><ins>+ <key>addresses</key>
+ <dict>
+ <key>rdn</key>
+ <string>ou=buildings</string>
+ <key>geoAttr</key>
+ <string></string>
+ <key>streetAddressAttr</key>
+ <string></string>
+ <key>mapping</key>
+ <dict>
+ <key>recordName</key>
+ <string>cn</string>
+ <key>fullName</key>
+ <string>cn</string>
+ </dict>
+ </dict>
</ins><span class="cx"> </dict>
</span><span class="cx"> <key>groupSchema</key>
</span><span class="cx"> <dict>
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavdirectoryldapdirectorypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/directory/ldapdirectory.py (12086 => 12087)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/directory/ldapdirectory.py        2013-12-13 18:21:26 UTC (rev 12086)
+++ CalendarServer/trunk/twistedcaldav/directory/ldapdirectory.py        2013-12-13 21:51:30 UTC (rev 12087)
</span><span class="lines">@@ -113,8 +113,6 @@
</span><span class="cx"> "guidAttr": "entryUUID",
</span><span class="cx"> "users": {
</span><span class="cx"> "rdn": "ou=People",
</span><del>- "attr": "uid", # used only to synthesize email address
- "emailSuffix": None, # used only to synthesize email address
</del><span class="cx"> "filter": None, # additional filter for this type
</span><span class="cx"> "loginEnabledAttr" : "", # attribute controlling login
</span><span class="cx"> "loginEnabledValue" : "yes", # "True" value of above attribute
</span><span class="lines">@@ -130,8 +128,6 @@
</span><span class="cx"> },
</span><span class="cx"> "groups": {
</span><span class="cx"> "rdn": "ou=Group",
</span><del>- "attr": "cn", # used only to synthesize email address
- "emailSuffix": None, # used only to synthesize email address
</del><span class="cx"> "filter": None, # additional filter for this type
</span><span class="cx"> "mapping" : { # maps internal record names to LDAP
</span><span class="cx"> "recordName": "cn",
</span><span class="lines">@@ -143,23 +139,18 @@
</span><span class="cx"> },
</span><span class="cx"> "locations": {
</span><span class="cx"> "rdn": "ou=Places",
</span><del>- "attr": "cn", # used only to synthesize email address
- "emailSuffix": None, # used only to synthesize email address
</del><span class="cx"> "filter": None, # additional filter for this type
</span><span class="cx"> "calendarEnabledAttr" : "", # attribute controlling enabledForCalendaring
</span><span class="cx"> "calendarEnabledValue" : "yes", # "True" value of above attribute
</span><ins>+ "associatedAddressAttr" : "",
</ins><span class="cx"> "mapping" : { # maps internal record names to LDAP
</span><span class="cx"> "recordName": "cn",
</span><span class="cx"> "fullName" : "cn",
</span><span class="cx"> "emailAddresses" : ["mail"], # multiple LDAP fields supported
</span><del>- "firstName" : "givenName",
- "lastName" : "sn",
</del><span class="cx"> },
</span><span class="cx"> },
</span><span class="cx"> "resources": {
</span><span class="cx"> "rdn": "ou=Resources",
</span><del>- "attr": "cn", # used only to synthesize email address
- "emailSuffix": None, # used only to synthesize email address
</del><span class="cx"> "filter": None, # additional filter for this type
</span><span class="cx"> "calendarEnabledAttr" : "", # attribute controlling enabledForCalendaring
</span><span class="cx"> "calendarEnabledValue" : "yes", # "True" value of above attribute
</span><span class="lines">@@ -167,10 +158,18 @@
</span><span class="cx"> "recordName": "cn",
</span><span class="cx"> "fullName" : "cn",
</span><span class="cx"> "emailAddresses" : ["mail"], # multiple LDAP fields supported
</span><del>- "firstName" : "givenName",
- "lastName" : "sn",
</del><span class="cx"> },
</span><span class="cx"> },
</span><ins>+ "addresses": {
+ "rdn": "ou=Buildings",
+ "filter": None, # additional filter for this type
+ "streetAddressAttr" : "",
+ "geoAttr" : "",
+ "mapping" : { # maps internal record names to LDAP
+ "recordName": "cn",
+ "fullName" : "cn",
+ },
+ },
</ins><span class="cx"> },
</span><span class="cx"> "groupSchema": {
</span><span class="cx"> "membersAttr": "member", # how members are specified
</span><span class="lines">@@ -238,8 +237,10 @@
</span><span class="cx"> for recordType in self.recordTypes():
</span><span class="cx"> if self.rdnSchema[recordType]["attr"]:
</span><span class="cx"> attrSet.add(self.rdnSchema[recordType]["attr"])
</span><del>- if self.rdnSchema[recordType].get("calendarEnabledAttr", False):
- attrSet.add(self.rdnSchema[recordType]["calendarEnabledAttr"])
</del><ins>+ for n in ("calendarEnabledAttr", "associatedAddressAttr",
+ "streetAddressAttr", "geoAttr"):
+ if self.rdnSchema[recordType].get(n, False):
+ attrSet.add(self.rdnSchema[recordType][n])
</ins><span class="cx"> for attrList in self.rdnSchema[recordType]["mapping"].values():
</span><span class="cx"> if attrList:
</span><span class="cx"> # Since emailAddresses can map to multiple LDAP fields,
</span><span class="lines">@@ -304,7 +305,7 @@
</span><span class="cx">
</span><span class="cx"> # Build filter
</span><span class="cx"> filterstr = "(!(objectClass=organizationalUnit))"
</span><del>- typeFilter = self.rdnSchema[recordType]["filter"]
</del><ins>+ typeFilter = self.rdnSchema[recordType].get("filter", "")
</ins><span class="cx"> if typeFilter:
</span><span class="cx"> filterstr = "(&%s%s)" % (filterstr, typeFilter)
</span><span class="cx">
</span><span class="lines">@@ -778,6 +779,7 @@
</span><span class="cx"> enabledForAddressBooks = None
</span><span class="cx"> uid = None
</span><span class="cx"> enabledForLogin = True
</span><ins>+ extras = {}
</ins><span class="cx">
</span><span class="cx"> shortNames = tuple(self._getMultipleLdapAttributes(attrs, self.rdnSchema[recordType]["mapping"]["recordName"]))
</span><span class="cx"> if not shortNames:
</span><span class="lines">@@ -794,17 +796,17 @@
</span><span class="cx">
</span><span class="cx"> # Find or build email
</span><span class="cx"> # (The emailAddresses mapping is a list of ldap fields)
</span><del>- emailAddressesMappedTo = self.rdnSchema[recordType]["mapping"]["emailAddresses"]
</del><ins>+ emailAddressesMappedTo = self.rdnSchema[recordType]["mapping"].get("emailAddresses", "")
</ins><span class="cx"> # Supporting either string or list for emailAddresses:
</span><span class="cx"> if isinstance(emailAddressesMappedTo, str):
</span><del>- emailAddresses = set(self._getMultipleLdapAttributes(attrs, self.rdnSchema[recordType]["mapping"]["emailAddresses"]))
</del><ins>+ emailAddresses = set(self._getMultipleLdapAttributes(attrs, self.rdnSchema[recordType]["mapping"].get("emailAddresses", "")))
</ins><span class="cx"> else:
</span><span class="cx"> emailAddresses = set(self._getMultipleLdapAttributes(attrs, *self.rdnSchema[recordType]["mapping"]["emailAddresses"]))
</span><del>- emailSuffix = self.rdnSchema[recordType]["emailSuffix"]
</del><ins>+ emailSuffix = self.rdnSchema[recordType].get("emailSuffix", None)
</ins><span class="cx">
</span><span class="cx"> if len(emailAddresses) == 0 and emailSuffix:
</span><span class="cx"> emailPrefix = self._getUniqueLdapAttribute(attrs,
</span><del>- self.rdnSchema[recordType]["attr"])
</del><ins>+ self.rdnSchema[recordType].get("attr", "cn"))
</ins><span class="cx"> emailAddresses.add(emailPrefix + emailSuffix)
</span><span class="cx">
</span><span class="cx"> proxyGUIDs = ()
</span><span class="lines">@@ -890,6 +892,25 @@
</span><span class="cx"> autoAcceptGroup = self._getUniqueLdapAttribute(attrs,
</span><span class="cx"> self.resourceSchema["autoAcceptGroupAttr"])
</span><span class="cx">
</span><ins>+ if recordType == self.recordType_locations:
+ if self.rdnSchema[recordType]["associatedAddressAttr"]:
+ associatedAddress = self._getUniqueLdapAttribute(attrs,
+ self.rdnSchema[recordType]["associatedAddressAttr"])
+ if associatedAddress:
+ extras["associatedAddress"] = associatedAddress
+
+ elif recordType == self.recordType_addresses:
+ if self.rdnSchema[recordType].get("geoAttr", ""):
+ geo = self._getUniqueLdapAttribute(attrs,
+ self.rdnSchema[recordType]["geoAttr"])
+ if geo:
+ extras["geo"] = geo
+ if self.rdnSchema[recordType].get("streetAddressAttr", ""):
+ street = self._getUniqueLdapAttribute(attrs,
+ self.rdnSchema[recordType]["streetAddressAttr"])
+ if street:
+ extras["streetAddress"] = street
+
</ins><span class="cx"> serverID = None
</span><span class="cx"> if self.poddingSchema["serverIdAttr"]:
</span><span class="cx"> serverID = self._getUniqueLdapAttribute(attrs,
</span><span class="lines">@@ -911,6 +932,7 @@
</span><span class="cx"> extProxies=proxyGUIDs,
</span><span class="cx"> extReadOnlyProxies=readOnlyProxyGUIDs,
</span><span class="cx"> attrs=attrs,
</span><ins>+ **extras
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> if self.augmentService is not None:
</span><span class="lines">@@ -981,7 +1003,7 @@
</span><span class="cx">
</span><span class="cx"> # Build filter
</span><span class="cx"> filterstr = "(!(objectClass=organizationalUnit))"
</span><del>- typeFilter = self.rdnSchema[recordType]["filter"]
</del><ins>+ typeFilter = self.rdnSchema[recordType].get("filter", "")
</ins><span class="cx"> if typeFilter:
</span><span class="cx"> filterstr = "(&%s%s)" % (filterstr, typeFilter)
</span><span class="cx">
</span><span class="lines">@@ -1003,17 +1025,17 @@
</span><span class="cx"> elif indexType == self.INDEX_TYPE_CUA:
</span><span class="cx"> # indexKey is of the form "mailto:test@example.net"
</span><span class="cx"> email = indexKey[7:] # strip "mailto:"
</span><del>- emailSuffix = self.rdnSchema[recordType]["emailSuffix"]
</del><ins>+ emailSuffix = self.rdnSchema[recordType].get("emailSuffix", None)
</ins><span class="cx"> if emailSuffix is not None and email.partition("@")[2] == emailSuffix:
</span><span class="cx"> filterstr = "(&%s(|(&(!(mail=*))(%s=%s))(mail=%s)))" % (
</span><span class="cx"> filterstr,
</span><del>- self.rdnSchema[recordType]["attr"],
</del><ins>+ self.rdnSchema[recordType].get("attr", "cn"),
</ins><span class="cx"> email.partition("@")[0],
</span><span class="cx"> ldapEsc(email)
</span><span class="cx"> )
</span><span class="cx"> else:
</span><span class="cx"> # emailAddresses can map to multiple LDAP fields
</span><del>- ldapFields = self.rdnSchema[recordType]["mapping"]["emailAddresses"]
</del><ins>+ ldapFields = self.rdnSchema[recordType]["mapping"].get("emailAddresses", "")
</ins><span class="cx"> if isinstance(ldapFields, str):
</span><span class="cx"> if ldapFields:
</span><span class="cx"> subfilter = "(%s=%s)" % (ldapFields, ldapEsc(email))
</span><span class="lines">@@ -1108,7 +1130,7 @@
</span><span class="cx"> typeCounts[recordType] = 0
</span><span class="cx"> base = self.typeDNs[recordType]
</span><span class="cx"> scope = ldap.SCOPE_SUBTREE
</span><del>- extraFilter = self.rdnSchema[recordType]["filter"]
</del><ins>+ extraFilter = self.rdnSchema[recordType].get("filter", "")
</ins><span class="cx"> filterstr = buildFilterFromTokens(recordType, self.rdnSchema[recordType]["mapping"],
</span><span class="cx"> tokens, extra=extraFilter)
</span><span class="cx">
</span><span class="lines">@@ -1509,7 +1531,7 @@
</span><span class="cx"> guid, shortNames, authIDs, fullName,
</span><span class="cx"> firstName, lastName, emailAddresses,
</span><span class="cx"> uid, dn, memberGUIDs, extProxies, extReadOnlyProxies,
</span><del>- attrs
</del><ins>+ attrs, **kwargs
</ins><span class="cx"> ):
</span><span class="cx"> super(LdapDirectoryRecord, self).__init__(
</span><span class="cx"> service=service,
</span><span class="lines">@@ -1524,6 +1546,7 @@
</span><span class="cx"> extProxies=extProxies,
</span><span class="cx"> extReadOnlyProxies=extReadOnlyProxies,
</span><span class="cx"> uid=uid,
</span><ins>+ **kwargs
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> # Save attributes of dn and attrs in case you might need them later
</span></span></pre></div>
<a id="CalendarServertrunktwistedcaldavdirectorytesttest_ldapdirectorypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twistedcaldav/directory/test/test_ldapdirectory.py (12086 => 12087)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twistedcaldav/directory/test/test_ldapdirectory.py        2013-12-13 18:21:26 UTC (rev 12086)
+++ CalendarServer/trunk/twistedcaldav/directory/test/test_ldapdirectory.py        2013-12-13 21:51:30 UTC (rev 12087)
</span><span class="lines">@@ -541,8 +541,6 @@
</span><span class="cx"> "recordName": "cn",
</span><span class="cx"> "fullName" : "cn",
</span><span class="cx"> "emailAddresses" : ["mail", "emailAliases"],
</span><del>- "firstName" : "givenName",
- "lastName" : "sn",
</del><span class="cx"> },
</span><span class="cx"> },
</span><span class="cx"> "locations": {
</span><span class="lines">@@ -552,12 +550,11 @@
</span><span class="cx"> "filter": "(objectClass=apple-resource)", # additional filter for this type
</span><span class="cx"> "calendarEnabledAttr" : "", # attribute controlling calendaring
</span><span class="cx"> "calendarEnabledValue" : "yes", # "True" value of above attribute
</span><ins>+ "associatedAddressAttr" : "assocAddr",
</ins><span class="cx"> "mapping": { # maps internal record names to LDAP
</span><span class="cx"> "recordName": "cn",
</span><span class="cx"> "fullName" : "cn",
</span><span class="cx"> "emailAddresses" : "", # old style, single string
</span><del>- "firstName" : "givenName",
- "lastName" : "sn",
</del><span class="cx"> },
</span><span class="cx"> },
</span><span class="cx"> "resources": {
</span><span class="lines">@@ -571,10 +568,17 @@
</span><span class="cx"> "recordName": "cn",
</span><span class="cx"> "fullName" : "cn",
</span><span class="cx"> "emailAddresses" : [], # new style, array
</span><del>- "firstName" : "givenName",
- "lastName" : "sn",
</del><span class="cx"> },
</span><span class="cx"> },
</span><ins>+ "addresses": {
+ "rdn": "cn=Buildings",
+ "geoAttr" : "coordinates",
+ "streetAddressAttr" : "postal",
+ "mapping": { # maps internal record names to LDAP
+ "recordName": "cn",
+ "fullName" : "cn",
+ },
+ },
</ins><span class="cx"> },
</span><span class="cx"> "groupSchema": {
</span><span class="cx"> "membersAttr": "uniqueMember", # how members are specified
</span><span class="lines">@@ -1514,6 +1518,39 @@
</span><span class="cx"> self.service.recordType_users)
</span><span class="cx"> self.assertEquals(record.guid, guid.upper())
</span><span class="cx">
</span><ins>+ # Location with associated Address
+
+ dn = "cn=odtestlocation,cn=locations,dc=example,dc=com"
+ guid = "D3094652-344B-4633-8DB8-09639FA00FB6"
+ attrs = {
+ "apple-generateduid": [guid],
+ "cn": ["odtestlocation"],
+ "assocAddr" : ["6C6CD280-E6E3-11DF-9492-0800200C9A66"],
+ }
+ record = self.service._ldapResultToRecord(dn, attrs,
+ self.service.recordType_locations)
+ self.assertEquals(record.extras, {
+ "associatedAddress": "6C6CD280-E6E3-11DF-9492-0800200C9A66"
+ })
+
+ # Address with street and geo
+
+ dn = "cn=odtestaddress,cn=buildings,dc=example,dc=com"
+ guid = "6C6CD280-E6E3-11DF-9492-0800200C9A66"
+ attrs = {
+ "apple-generateduid": [guid],
+ "cn": ["odtestaddress"],
+ "coordinates" : ["geo:1,2"],
+ "postal" : ["1 Infinite Loop, Cupertino, CA"],
+ }
+ record = self.service._ldapResultToRecord(dn, attrs,
+ self.service.recordType_addresses)
+ self.assertEquals(record.extras, {
+ "geo": "geo:1,2",
+ "streetAddress" : "1 Infinite Loop, Cupertino, CA",
+ })
+
+
</ins><span class="cx"> def test_listRecords(self):
</span><span class="cx"> """
</span><span class="cx"> listRecords makes an LDAP query (with fake results in this test)
</span></span></pre>
</div>
</div>
</body>
</html>