]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python/samba/tests: py3 port for samba.test.password_hash_ldap
authorNoel Power <noel.power@suse.com>
Wed, 9 May 2018 10:37:16 +0000 (11:37 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 5 Sep 2018 21:27:11 +0000 (23:27 +0200)
user samba.compat.text_type instead of unicode

in py2 text_type is an alias for unicode
in py3 text_type is an alias for str (which does nothing if
the input is already str)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/password_hash_ldap.py

index c1e6cd574423cabad0c33b534c516e75d31b027d..5bb407e09065b7acfbc5d2a926687606807ced6a 100644 (file)
@@ -46,6 +46,7 @@ from samba.ndr import ndr_unpack
 from samba.dcerpc import drsblobs, drsuapi, misc
 from samba import drs_utils, net
 from samba.credentials import Credentials
+from samba.compat import text_type
 import binascii
 import os
 
@@ -72,7 +73,7 @@ class PassWordHashLDAPTests(PassWordHashTests):
         req8.destination_dsa_guid          = null_guid
         req8.source_dsa_invocation_id      = null_guid
         req8.naming_context                = drsuapi.DsReplicaObjectIdentifier()
-        req8.naming_context.dn             = unicode(dn)
+        req8.naming_context.dn             = text_type(dn)
 
         req8.highwatermark = drsuapi.DsReplicaHighWaterMark()
         req8.highwatermark.tmp_highest_usn = 0