mirror of
https://github.com/samba-team/samba.git
synced 2025-01-22 22:04:08 +03:00
tests/py/rodc_rwdc: Fix py2/py3 .next compat issues
Python 3 does not have .next(), which we rely on, change the code slightly so it works in py2/py3 (using builtin next function) Pair-programmed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org> Autobuild-Date(master): Fri Nov 2 06:56:24 CET 2018 on sn-devel-144
This commit is contained in:
parent
78f5b6e399
commit
537a26d6d1
@ -115,7 +115,6 @@ def get_server_ref_from_samdb(samdb):
|
||||
|
||||
|
||||
class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
counter = itertools.count(1).next
|
||||
|
||||
def _check_account_initial(self, dn):
|
||||
self.force_replication()
|
||||
@ -686,7 +685,7 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
|
||||
|
||||
|
||||
class RodcRwdcTests(password_lockout_base.BasePasswordTestCase):
|
||||
counter = itertools.count(1).next
|
||||
counter = itertools.count(1, 1)
|
||||
|
||||
def force_replication(self, base=None):
|
||||
if base is None:
|
||||
@ -982,7 +981,7 @@ class RodcRwdcTests(password_lockout_base.BasePasswordTestCase):
|
||||
self._test_add_modify_delete()
|
||||
|
||||
def _new_user(self):
|
||||
username = "u%sX%s" % (self.tag[:12], self.counter())
|
||||
username = "u%sX%s" % (self.tag[:12], next(self.counter))
|
||||
password = 'password#1'
|
||||
dn = 'CN=%s,CN=Users,%s' % (username, self.base_dn)
|
||||
o = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user