Did I find the right examples for you? yes no

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
dict() -> new empty dictionary
dict(mapping) -> new dictionary initialized from a mapping object's
    (key, value) pairs
dict(iterable) -> new dictionary initialized as if via:
    d = {}
    for k, v in iterable:
        d[k] = v
dict(**kwargs) -> new dictionary initialized with the name=value pairs
    in the keyword argument list.  For example:  dict(one=1, two=2)

src/a/r/archetypes.ldapstorage-0.1a1/archetypes/ldapstorage/tests/testLDAPStorage.py   archetypes.ldapstorage(Download)
        conn = self.portal.ldap_connection
        results = conn.search('uid=content1,%s' % \
            tests_config.LDAP_SETTINGS['base_dn'])
        self.failUnless(results)
 
        conn = self.portal.ldap_connection
        results = conn.search('cn=%s,%s' % (rdn_value, 
            tests_config.LDAP_SETTINGS['base_dn']))
        self.failUnless(results)
 
 
        results = conn.search('cn=%s,%s' % (rdn_value,
            tests_config.LDAP_SETTINGS['base_dn']))
 
        # compare rdn value
        # test values in LDAP
        conn = self.portal.ldap_connection
        dn = 'uid=content1,%s' % tests_config.LDAP_SETTINGS['base_dn']
        results = conn.search(dn, ldap.SCOPE_BASE)
        self.failUnlessEqual(results[0][1]['homePostalAddress'][0], 
        self.folder.manage_renameObject('content1', 'content2')
 
        old_dn = 'uid=content1,%s' % tests_config.LDAP_SETTINGS['base_dn']
        new_dn = 'uid=content2,%s' % tests_config.LDAP_SETTINGS['base_dn']
 

src/p/r/Products.ldapconnection-0.1a1/Products/ldapconnection/tests/testLDAPConnection.py   Products.ldapconnection(Download)
from Products.ldapconnection import LDAPConnection
from Products.ldapconnection.exceptions import LDAPReadOnlyError
from config import LDAP_SETTINGS
import ldap
import transaction
    def _addEntries(self, conn):
        """ Add entries to directory. """
        dn = 'ou=testentry,%s' % LDAP_SETTINGS['base_dn']
        attribute_dict = {
            'objectClass': 'organizationalUnit',
    def _delEntries(self, conn):
        """ Delete de entries added. """
        dn = 'ou=testentry,%s' % LDAP_SETTINGS['base_dn']
        try:
            conn.deleteEntry(dn)
    def testAddEntries(self):
        conn = self.connect()
        self._addEntries(conn)
        dn = 'ou=testentry,%s' % LDAP_SETTINGS['base_dn']
        results = conn.search(dn, ldap.SCOPE_BASE)
    def testSearchEntries(self):
        conn = self.connect()
        self._addEntries(conn)
        dn = 'ou=testentry,%s' % LDAP_SETTINGS['base_dn']
        self.failUnless(conn.search(dn, ldap.SCOPE_BASE))