Imported Debian patch 4.0.5-6~numeezy
This commit is contained in:
committed by
Mario Fetka
parent
c44de33144
commit
10dfc9587b
@@ -34,9 +34,6 @@ from ipalib.constants import NAME_REGEX, NAME_ERROR
|
||||
from ipalib import config, constants, base
|
||||
from ipaplatform.paths import paths
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.tier0
|
||||
|
||||
# Valid environment variables in (key, raw, value) tuples:
|
||||
# key: the name of the environment variable
|
||||
@@ -169,7 +166,7 @@ class test_Env(ClassChecker):
|
||||
assert o.__islocked__() is False
|
||||
o.__lock__()
|
||||
assert o.__islocked__() is True
|
||||
e = raises(Exception, o.__lock__)
|
||||
e = raises(StandardError, o.__lock__)
|
||||
assert str(e) == 'Env.__lock__() already called'
|
||||
|
||||
# Also test with base.lock() function:
|
||||
@@ -301,7 +298,7 @@ class test_Env(ClassChecker):
|
||||
"""
|
||||
o = self.cls()
|
||||
assert len(o) == 0
|
||||
for i in range(1, 11):
|
||||
for i in xrange(1, 11):
|
||||
key = 'key%d' % i
|
||||
value = u'value %d' % i
|
||||
o[key] = value
|
||||
@@ -348,7 +345,7 @@ class test_Env(ClassChecker):
|
||||
expected.update(dict(group1))
|
||||
assert list(o) == sorted(expected)
|
||||
assert expected['key2'] == 'value 2' # And not 'Value 2'
|
||||
for (key, value) in expected.items():
|
||||
for (key, value) in expected.iteritems():
|
||||
assert getattr(o, key) is value
|
||||
assert o[key] is value
|
||||
assert o._merge(**expected) == (0, 6)
|
||||
@@ -393,7 +390,7 @@ class test_Env(ClassChecker):
|
||||
for (k, v) in orig.items():
|
||||
assert o[k] is v
|
||||
assert list(o) == sorted(keys + ('key0', 'key1', 'key2', 'key3', 'config_loaded'))
|
||||
for i in range(4):
|
||||
for i in xrange(4):
|
||||
assert o['key%d' % i] == ('var%d' % i)
|
||||
keys = tuple(o)
|
||||
|
||||
@@ -432,7 +429,7 @@ class test_Env(ClassChecker):
|
||||
assert o._isdone('_bootstrap') is False
|
||||
o._bootstrap(**overrides)
|
||||
assert o._isdone('_bootstrap') is True
|
||||
e = raises(Exception, o._bootstrap)
|
||||
e = raises(StandardError, o._bootstrap)
|
||||
assert str(e) == 'Env._bootstrap() already called'
|
||||
return (o, home)
|
||||
|
||||
@@ -515,7 +512,7 @@ class test_Env(ClassChecker):
|
||||
assert key in o
|
||||
|
||||
# Check that it can't be called twice:
|
||||
e = raises(Exception, o._finalize_core)
|
||||
e = raises(StandardError, o._finalize_core)
|
||||
assert str(e) == 'Env._finalize_core() already called'
|
||||
|
||||
return (o, home)
|
||||
@@ -589,7 +586,7 @@ class test_Env(ClassChecker):
|
||||
assert o._isdone('_finalize') is True
|
||||
|
||||
# Check that it can't be called twice:
|
||||
e = raises(Exception, o._finalize)
|
||||
e = raises(StandardError, o._finalize)
|
||||
assert str(e) == 'Env._finalize() already called'
|
||||
|
||||
# Check that _finalize() calls __lock__()
|
||||
@@ -597,7 +594,7 @@ class test_Env(ClassChecker):
|
||||
assert o.__islocked__() is False
|
||||
o._finalize()
|
||||
assert o.__islocked__() is True
|
||||
e = raises(Exception, o.__lock__)
|
||||
e = raises(StandardError, o.__lock__)
|
||||
assert str(e) == 'Env.__lock__() already called'
|
||||
|
||||
# Check that **lastchance works
|
||||
|
||||
Reference in New Issue
Block a user