#NEWLINE# def testSearch_noAttributes( self ) : #NEWLINE# #INDENT# 'Search with attributes=None returns no attributes.' #NEWLINE# client = LDAPClientTestDriver ( [ pureldap . LDAPSearchResultEntry ( 'cn=foo,dc=example,dc=com' , attributes = ( ) ) , pureldap . LDAPSearchResultEntry ( 'cn=bar,dc=example,dc=com' , attributes = ( ) ) , pureldap . LDAPSearchResultDone ( resultCode = 0 , matchedDN = '' , errorMessage = '' ) ] ) #NEWLINE# o = ldapsyntax . LDAPEntry ( client = client , dn = 'dc=example,dc=com' , attributes = { #NEWLINE# #INDENT# 'objectClass' : [ 'organizationalUnit' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# d = o . search ( filterText = '(foo=a)' , attributes = None ) #NEWLINE# def cb( val ) : #NEWLINE# #INDENT# client . assertSent ( pureldap . LDAPSearchRequest ( baseObject = 'dc=example,dc=com' , scope = pureldap . LDAP_SCOPE_wholeSubtree , derefAliases = pureldap . LDAP_DEREF_neverDerefAliases , sizeLimit = 0 , timeLimit = 0 , typesOnly = 0 , filter = pureldap . LDAPFilter_equalityMatch ( attributeDesc = pureldap . LDAPAttributeDescription ( value = 'foo' ) , assertionValue = pureldap . LDAPAssertionValue ( value = 'a' ) ) , attributes = [ '1.1' ] ) ) #NEWLINE# self . failUnlessEqual ( len ( val ) , 2 ) #NEWLINE# self . failUnlessEqual ( val [ 0 ] , ldapsyntax . LDAPEntry ( client = client , dn = 'cn=foo,dc=example,dc=com' ) ) #NEWLINE# self . failIf ( val [ 0 ] . complete ) #NEWLINE# self . failUnlessEqual ( val [ 1 ] , ldapsyntax . LDAPEntry ( client = client , dn = 'cn=bar,dc=example,dc=com' ) ) #NEWLINE# self . failIf ( val [ 1 ] . complete ) #NEWLINE# #UNINDENT# d . addCallback ( cb ) #NEWLINE# return d