# Path: ldaptor/protocols/ldap/ldapsyntax.py
# class PasswordSetAggregateError(Exception):
# class PasswordSetAborted(Exception):
# class DNNotPresentError(Exception):
# class ObjectInBadStateError(Exception):
# class ObjectDeletedError(ObjectInBadStateError):
# class ObjectDirtyError(ObjectInBadStateError):
# class NoContainingNamingContext(Exception):
# class CannotRemoveRDNError(Exception):
# class MatchNotImplemented(NotImplementedError):
# class JournaledLDAPAttributeSet(attributeset.LDAPAttributeSet):
# class LDAPEntryWithClient(entry.EditableLDAPEntry):
# class LDAPEntryWithAutoFill(LDAPEntry):
#     def __init__(self, errors):
#     def __str__(self):
#     def __repr__(self):
#     def __str__(self):
#     def __init__(self, key, val=None):
#     def __str__(self):
#     def __init__(self, op):
#     def __str__(self):
#     def __init__(self, ldapObject, *a, **kw):
#     def add(self, value):
#     def update(self, sequence):
#     def remove(self, value):
#     def clear(self):
#     def __init__(self, client, dn, attributes={}, complete=0):
#     def buildAttributeSet(self, key, values):
#     def _canRemove(self, key, value):
#     def _canRemoveAll(self, key):
#     def _checkState(self):
#     def journal(self, journalOperation):
#     def __getitem__(self, *a, **kw):
#     def get(self, *a, **kw):
#     def has_key(self, *a, **kw):
#     def __contains__(self, key):
#     def keys(self):
#     def items(self):
#     def __str__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __len__(self):
#     def __nonzero__(self):
#     def bind(self, password):
#     def _handle_bind_msg(self, msg):
#     def __setitem__(self, key, value):
#     def __delitem__(self, key):
#     def undo(self):
#     def _commit_success(self, msg):
#     def commit(self):
#     def _cbMoveDone(self, msg, newDN):
#     def move(self, newDN):
#     def _cbDeleteDone(self, msg):
#     def delete(self):
#     def _cbAddDone(self, msg, dn):
#     def addChild(self, rdn, attributes):
#     def _cbSetPassword_ExtendedOperation(self, msg):
#     def setPassword_ExtendedOperation(self, newPasswd):
#     def setPassword_Samba(self, newPasswd, style=None):
#     def setPasswordMaybe_Samba(self, newPasswd):
#     def _cbSetPassword(self, dl, names):
#     def _cbSetPassword_one(self, result):
#     def _ebSetPassword_one(self, fail):
#     def _setPasswordAll(self, results, newPasswd, prefix, names):
#             def cb((success, info)):
#     def setPassword(self, newPasswd):
#         def _passwordChangerPriorityComparison(me, other):
#     def _cbNamingContext_Entries(self, results):
#     def namingContext(self):
#     def _cbFetch(self, results, overWrite):
#     def fetch(self, *attributes):
#     def _cbSearchEntry(self, callback, objectName, attributes, complete):
#     def _cbSearchMsg(self, msg, d, callback, complete, sizeLimitIsNonFatal):
#     def search(self,
#                filterText=None,
#                filterObject=None,
#                attributes=(),
#                scope=None,
#                derefAliases=None,
#                sizeLimit=0,
#                sizeLimitIsNonFatal=False,
#                timeLimit=0,
#                typesOnly=0,
#                callback=None):
#             def rerouteerr(e):
#     def lookup(self, dn):
#     def __repr__(self):
#     def __init__(self, *args, **kwargs):
#     def _cb_addAutofiller(self, r, autoFiller):
#     def addAutofiller(self, autoFiller):
#     def journal(self, journalOperation):
# 
# Path: ldaptor/protocols/ldap/autofill/sambaAccount.py
# class Autofill_samba: #TODO baseclass
#     def start(self, ldapObject):
#     def notify(self, ldapObject, attributeType):
# 
# Path: ldaptor/protocols/ldap/autofill/sambaSamAccount.py
# class Autofill_samba: #TODO baseclass
#     def __init__(self, domainSID, fixedPrimaryGroupSID=None):
#     def start(self, ldapObject):
#     def notify(self, ldapObject, attributeType):
# 
# Path: ldaptor/testutil.py
# def mustRaise(dummy):
# def calltrace():
#     def printfuncnames(frame, event, arg):
#     def __init__(self, proto):
#     def loseConnection(self):
#     def __init__(self, *responses):
#     def send(self, op):
#     def send_multiResponse(self, op, handler, *args, **kwargs):
#     def send_noResponse(self, op):
#     def _response(self):
#     def assertNothingSent(self):
#     def assertSent(self, *shouldBeSent):
#     def connectionMade(self):
#     def connectionLost(self, reason=None):
#     def unbind(self):
# def createServer(proto, *responses, **kw):
#     def createClient(factory):
# class FakeTransport:
# class LDAPClientTestDriver:


import sets
from twisted.trial import unittest
from ldaptor.protocols.ldap import ldapsyntax
from ldaptor.protocols.ldap.autofill import sambaAccount, sambaSamAccount
from ldaptor import testutil
"""
Test cases for ldaptor.protocols.ldap.autofill.sambaAccount module.
"""


class LDAPAutoFill_sambaAccount(unittest.TestCase):
    def testMustHaveObjectClass(self):
        """Test that Autofill_samba fails unless object is a sambaAccount."""
        client = testutil.LDAPClientTestDriver()
        o=ldapsyntax.LDAPEntryWithAutoFill(client=client,
                                           dn='cn=foo,dc=example,dc=com',
                                           attributes={
            'objectClass': ['something', 'other'],
            })
        autoFiller = sambaAccount.Autofill_samba()
        d = o.addAutofiller(autoFiller)

        def eb(val):
            client.assertNothingSent()

# Path: ldaptor/protocols/ldap/ldapsyntax.py
# class PasswordSetAggregateError(Exception):
# class PasswordSetAborted(Exception):
# class DNNotPresentError(Exception):
# class ObjectInBadStateError(Exception):
# class ObjectDeletedError(ObjectInBadStateError):
# class ObjectDirtyError(ObjectInBadStateError):
# class NoContainingNamingContext(Exception):
# class CannotRemoveRDNError(Exception):
# class MatchNotImplemented(NotImplementedError):
# class JournaledLDAPAttributeSet(attributeset.LDAPAttributeSet):
# class LDAPEntryWithClient(entry.EditableLDAPEntry):
# class LDAPEntryWithAutoFill(LDAPEntry):
#     def __init__(self, errors):
#     def __str__(self):
#     def __repr__(self):
#     def __str__(self):
#     def __init__(self, key, val=None):
#     def __str__(self):
#     def __init__(self, op):
#     def __str__(self):
#     def __init__(self, ldapObject, *a, **kw):
#     def add(self, value):
#     def update(self, sequence):
#     def remove(self, value):
#     def clear(self):
#     def __init__(self, client, dn, attributes={}, complete=0):
#     def buildAttributeSet(self, key, values):
#     def _canRemove(self, key, value):
#     def _canRemoveAll(self, key):
#     def _checkState(self):
#     def journal(self, journalOperation):
#     def __getitem__(self, *a, **kw):
#     def get(self, *a, **kw):
#     def has_key(self, *a, **kw):
#     def __contains__(self, key):
#     def keys(self):
#     def items(self):
#     def __str__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __len__(self):
#     def __nonzero__(self):
#     def bind(self, password):
#     def _handle_bind_msg(self, msg):
#     def __setitem__(self, key, value):
#     def __delitem__(self, key):
#     def undo(self):
#     def _commit_success(self, msg):
#     def commit(self):
#     def _cbMoveDone(self, msg, newDN):
#     def move(self, newDN):
#     def _cbDeleteDone(self, msg):
#     def delete(self):
#     def _cbAddDone(self, msg, dn):
#     def addChild(self, rdn, attributes):
#     def _cbSetPassword_ExtendedOperation(self, msg):
#     def setPassword_ExtendedOperation(self, newPasswd):
#     def setPassword_Samba(self, newPasswd, style=None):
#     def setPasswordMaybe_Samba(self, newPasswd):
#     def _cbSetPassword(self, dl, names):
#     def _cbSetPassword_one(self, result):
#     def _ebSetPassword_one(self, fail):
#     def _setPasswordAll(self, results, newPasswd, prefix, names):
#             def cb((success, info)):
#     def setPassword(self, newPasswd):
#         def _passwordChangerPriorityComparison(me, other):
#     def _cbNamingContext_Entries(self, results):
#     def namingContext(self):
#     def _cbFetch(self, results, overWrite):
#     def fetch(self, *attributes):
#     def _cbSearchEntry(self, callback, objectName, attributes, complete):
#     def _cbSearchMsg(self, msg, d, callback, complete, sizeLimitIsNonFatal):
#     def search(self,
#                filterText=None,
#                filterObject=None,
#                attributes=(),
#                scope=None,
#                derefAliases=None,
#                sizeLimit=0,
#                sizeLimitIsNonFatal=False,
#                timeLimit=0,
#                typesOnly=0,
#                callback=None):
#             def rerouteerr(e):
#     def lookup(self, dn):
#     def __repr__(self):
#     def __init__(self, *args, **kwargs):
#     def _cb_addAutofiller(self, r, autoFiller):
#     def addAutofiller(self, autoFiller):
#     def journal(self, journalOperation):
# 
# Path: ldaptor/protocols/ldap/autofill/sambaAccount.py
# class Autofill_samba: #TODO baseclass
#     def start(self, ldapObject):
#     def notify(self, ldapObject, attributeType):
# 
# Path: ldaptor/protocols/ldap/autofill/sambaSamAccount.py
# class Autofill_samba: #TODO baseclass
#     def __init__(self, domainSID, fixedPrimaryGroupSID=None):
#     def start(self, ldapObject):
#     def notify(self, ldapObject, attributeType):
# 
# Path: ldaptor/testutil.py
# def mustRaise(dummy):
# def calltrace():
#     def printfuncnames(frame, event, arg):
#     def __init__(self, proto):
#     def loseConnection(self):
#     def __init__(self, *responses):
#     def send(self, op):
#     def send_multiResponse(self, op, handler, *args, **kwargs):
#     def send_noResponse(self, op):
#     def _response(self):
#     def assertNothingSent(self):
#     def assertSent(self, *shouldBeSent):
#     def connectionMade(self):
#     def connectionLost(self, reason=None):
#     def unbind(self):
# def createServer(proto, *responses, **kw):
#     def createClient(factory):
# class FakeTransport:
# class LDAPClientTestDriver:


# Path: ldaptor/test/test_autofill_samba.py
import sets
from twisted.trial import unittest
from ldaptor.protocols.ldap import ldapsyntax
from ldaptor.protocols.ldap.autofill import sambaAccount, sambaSamAccount
from ldaptor import testutil

"""
Test cases for ldaptor.protocols.ldap.autofill.sambaAccount module.
"""


class LDAPAutoFill_sambaAccount(unittest.TestCase):
    def testMustHaveObjectClass(self):
        """Test that Autofill_samba fails unless object is a sambaAccount."""
        client = testutil.LDAPClientTestDriver()
        o=ldapsyntax.LDAPEntryWithAutoFill(client=client,
                                           dn='cn=foo,dc=example,dc=com',
                                           attributes={
            'objectClass': ['something', 'other'],
            })
        autoFiller = sambaAccount.Autofill_samba()
        d = o.addAutofiller(autoFiller)

        def eb(val):
            client.assertNothingSent()

            val.trap(sambaAccount.ObjectMissingObjectClassException)