def testPasswordSettingAll_maybeSamba_WillFind(self):
        client = LDAPClientTestDriver(
            [pureldap.LDAPExtendedResponse(resultCode=0,
                                           matchedDN='',
                                           errorMessage='')],
            [
            pureldap.LDAPSearchResultEntry(objectName='',
                                           attributes=[('objectClass',
                                                        ('foo',
                                                         'sambaAccount',
                                                         'bar'))]),
            pureldap.LDAPSearchResultDone(resultCode=0,
                                          matchedDN='',
                                          errorMessage=''),
            ],
            [pureldap.LDAPModifyResponse(resultCode=0,
                                         matchedDN='',
                                         errorMessage='')],
            )

        o=ldapsyntax.LDAPEntry(client=client, dn='cn=foo,dc=example,dc=com')
        d=o.setPassword(newPasswd='new')
        def cb(dummy):
            client.assertSent(
                pureldap.LDAPPasswordModifyRequest(userIdentity='cn=foo,dc=example,dc=com',
                                                   newPasswd='new'),
                pureldap.LDAPSearchRequest(baseObject='cn=foo,dc=example,dc=com',
                                           scope=pureldap.LDAP_SCOPE_baseObject,
                                           derefAliases=pureldap.LDAP_DEREF_neverDerefAliases,
                                           sizeLimit=0,
                                           timeLimit=0,
                                           typesOnly=0,
                                           filter=pureldap.LDAPFilterMatchAll,
                                           attributes=('objectClass',)),
                delta.ModifyOp('cn=foo,dc=example,dc=com', [
                delta.Replace('ntPassword', ['89963F5042E5041A59C249282387A622']),
                delta.Replace('lmPassword', ['XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX']),
                ]).asLDAP(),
                )
        d.addCallback(cb)
        return d
LDAPEntry.setPassword(newPasswd=...) changes the password.
dataset/ETHPy150Open twisted/ldaptor/ldaptor/test/test_ldapsyntax.py/LDAPSyntaxPasswords.testPasswordSettingAll_maybeSamba_WillFind