# Path: ldaptor/config.py
# class MissingBaseDNError(Exception):
# class LDAPConfig(object):
#     def __str__(self):
#     def __init__(self,
#                  baseDN=None,
#                  serviceLocationOverrides=None,
#                  identityBaseDN=None,
#                  identitySearch=None):
#     def getBaseDN(self):
#     def getServiceLocationOverrides(self):
#     def _loadServiceLocationOverrides(self):
#     def copy(self, **kw):
#     def getIdentityBaseDN(self):
#     def getIdentitySearch(self, name):
# def loadConfig(configFiles=None,
#                reload=False):
# def useLMhash():
# DEFAULTS = {
#     'samba': { 'use-lmhash': 'no',
#                },
#     }
# CONFIG_FILES = [
#     '/etc/ldaptor/global.cfg',
#     os.path.expanduser('~/.ldaptor/global.cfg'),
#     ]


from twisted.internet import defer
from twisted.python import failure
from twisted.trial import unittest
from twisted.test import proto_helpers
from ldaptor import config
    import sys
            shouldBeSentStr,
            sentStr)

    def connectionMade(self):
        """TCP connection has opened"""
        self.connected = 1

    def connectionLost(self, reason=None):
        """Called when TCP connection has been lost"""
        assert not self.responses, \
               "connectionLost called even when have responses left: %r" % self.responses
        self.connected = 0

    def unbind(self):
        assert self.connected
        r='fake-unbind-by-LDAPClientTestDriver'
        self.send_noResponse(r)
        self.transport.loseConnection()

def createServer(proto, *responses, **kw):
    def createClient(factory):
        factory.doStart()
        #TODO factory.startedConnecting(c)
        proto = factory.buildProtocol(addr=None)
        proto.connectionMade()
    cfg = config.loadConfig(
        configFiles=[],
        reload=True)
    overrides = kw.setdefault('serviceLocationOverrides', {})
    overrides.setdefault('', createClient)

# Path: ldaptor/config.py
# class MissingBaseDNError(Exception):
# class LDAPConfig(object):
#     def __str__(self):
#     def __init__(self,
#                  baseDN=None,
#                  serviceLocationOverrides=None,
#                  identityBaseDN=None,
#                  identitySearch=None):
#     def getBaseDN(self):
#     def getServiceLocationOverrides(self):
#     def _loadServiceLocationOverrides(self):
#     def copy(self, **kw):
#     def getIdentityBaseDN(self):
#     def getIdentitySearch(self, name):
# def loadConfig(configFiles=None,
#                reload=False):
# def useLMhash():
# DEFAULTS = {
#     'samba': { 'use-lmhash': 'no',
#                },
#     }
# CONFIG_FILES = [
#     '/etc/ldaptor/global.cfg',
#     os.path.expanduser('~/.ldaptor/global.cfg'),
#     ]


# Path: ldaptor/testutil.py
from twisted.internet import defer
from twisted.python import failure
from twisted.trial import unittest
from twisted.test import proto_helpers
from ldaptor import config
    import sys

            shouldBeSentStr,
            sentStr)

    def connectionMade(self):
        """TCP connection has opened"""
        self.connected = 1

    def connectionLost(self, reason=None):
        """Called when TCP connection has been lost"""
        assert not self.responses, \
               "connectionLost called even when have responses left: %r" % self.responses
        self.connected = 0

    def unbind(self):
        assert self.connected
        r='fake-unbind-by-LDAPClientTestDriver'
        self.send_noResponse(r)
        self.transport.loseConnection()

def createServer(proto, *responses, **kw):
    def createClient(factory):
        factory.doStart()
        #TODO factory.startedConnecting(c)
        proto = factory.buildProtocol(addr=None)
        proto.connectionMade()
    cfg = config.loadConfig(
        configFiles=[],
        reload=True)
    overrides = kw.setdefault('serviceLocationOverrides', {})
    overrides.setdefault('', createClient)

    conf = config.LDAPConfig(**kw)