Renamed tests/tstutil.py to tests/util.py

This commit is contained in:
Jason Gerard DeRose
2008-10-07 22:30:53 -06:00
parent 3fdabc604e
commit deb8e3dfc8
11 changed files with 30 additions and 30 deletions

View File

@@ -22,7 +22,7 @@ Test the `ipalib.backend` module.
""" """
from ipalib import backend, plugable, errors from ipalib import backend, plugable, errors
from tests.tstutil import ClassChecker from tests.util import ClassChecker
class test_Backend(ClassChecker): class test_Backend(ClassChecker):

View File

@@ -21,7 +21,7 @@
Test the `ipalib.cli` module. Test the `ipalib.cli` module.
""" """
from tests.tstutil import raises, getitem, no_set, no_del, read_only, ClassChecker from tests.util import raises, getitem, no_set, no_del, read_only, ClassChecker
from ipalib import cli, plugable from ipalib import cli, plugable

View File

@@ -23,7 +23,7 @@ Test the `ipalib.config` module.
import types import types
from tests.tstutil import raises from tests.util import raises
from ipalib import config from ipalib import config

View File

@@ -21,7 +21,7 @@
Test the `ipalib.crud` module. Test the `ipalib.crud` module.
""" """
from tests.tstutil import read_only, raises, ClassChecker from tests.util import read_only, raises, ClassChecker
from ipalib import crud, frontend, plugable, config from ipalib import crud, frontend, plugable, config
def get_api(): def get_api():

View File

@@ -21,7 +21,7 @@
Test the `ipalib.errors` module. Test the `ipalib.errors` module.
""" """
from tests.tstutil import raises, ClassChecker from tests.util import raises, ClassChecker
from ipalib import errors from ipalib import errors

View File

@@ -21,8 +21,8 @@
Test the `ipalib.frontend` module. Test the `ipalib.frontend` module.
""" """
from tests.tstutil import raises, getitem, no_set, no_del, read_only, ClassChecker from tests.util import raises, getitem, no_set, no_del, read_only, ClassChecker
from tests.tstutil import check_TypeError from tests.util import check_TypeError
from ipalib import frontend, backend, plugable, errors, ipa_types, config from ipalib import frontend, backend, plugable, errors, ipa_types, config

View File

@@ -21,7 +21,7 @@
Test the `ipalib.ipa_types` module. Test the `ipalib.ipa_types` module.
""" """
from tests.tstutil import raises, getitem, no_set, no_del, read_only, ClassChecker from tests.util import raises, getitem, no_set, no_del, read_only, ClassChecker
from ipalib import ipa_types, errors, plugable from ipalib import ipa_types, errors, plugable

View File

@@ -21,9 +21,9 @@
Test the `ipalib.plugable` module. Test the `ipalib.plugable` module.
""" """
from tests.tstutil import raises, no_set, no_del, read_only from tests.util import raises, no_set, no_del, read_only
from tests.tstutil import getitem, setitem, delitem from tests.util import getitem, setitem, delitem
from tests.tstutil import ClassChecker from tests.util import ClassChecker
from ipalib import plugable, errors from ipalib import plugable, errors

View File

@@ -21,7 +21,7 @@
Test the `ipalib.util` module. Test the `ipalib.util` module.
""" """
from tests.tstutil import raises from tests.util import raises
from ipalib import util from ipalib import util

View File

@@ -18,10 +18,10 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
""" """
Test the `tests.tstutil` module. Test the `tests.util` module.
""" """
import tstutil import util
class Prop(object): class Prop(object):
@@ -48,7 +48,7 @@ class Prop(object):
def test_yes_raised(): def test_yes_raised():
f = tstutil.raises f = util.raises
class SomeError(Exception): class SomeError(Exception):
pass pass
@@ -79,54 +79,54 @@ def test_yes_raised():
raised = False raised = False
try: try:
f(SomeError, callback3) f(SomeError, callback3)
except tstutil.ExceptionNotRaised: except util.ExceptionNotRaised:
raised = True raised = True
assert raised assert raised
def test_no_set(): def test_no_set():
# Tests that it works when prop cannot be set: # Tests that it works when prop cannot be set:
tstutil.no_set(Prop('get', 'del'), 'prop') util.no_set(Prop('get', 'del'), 'prop')
# Tests that ExceptionNotRaised is raised when prop *can* be set: # Tests that ExceptionNotRaised is raised when prop *can* be set:
raised = False raised = False
try: try:
tstutil.no_set(Prop('set'), 'prop') util.no_set(Prop('set'), 'prop')
except tstutil.ExceptionNotRaised: except util.ExceptionNotRaised:
raised = True raised = True
assert raised assert raised
def test_no_del(): def test_no_del():
# Tests that it works when prop cannot be deleted: # Tests that it works when prop cannot be deleted:
tstutil.no_del(Prop('get', 'set'), 'prop') util.no_del(Prop('get', 'set'), 'prop')
# Tests that ExceptionNotRaised is raised when prop *can* be set: # Tests that ExceptionNotRaised is raised when prop *can* be set:
raised = False raised = False
try: try:
tstutil.no_del(Prop('del'), 'prop') util.no_del(Prop('del'), 'prop')
except tstutil.ExceptionNotRaised: except util.ExceptionNotRaised:
raised = True raised = True
assert raised assert raised
def test_read_only(): def test_read_only():
# Test that it works when prop is read only: # Test that it works when prop is read only:
assert tstutil.read_only(Prop('get'), 'prop') == 'prop value' assert util.read_only(Prop('get'), 'prop') == 'prop value'
# Test that ExceptionNotRaised is raised when prop can be set: # Test that ExceptionNotRaised is raised when prop can be set:
raised = False raised = False
try: try:
tstutil.read_only(Prop('get', 'set'), 'prop') util.read_only(Prop('get', 'set'), 'prop')
except tstutil.ExceptionNotRaised: except util.ExceptionNotRaised:
raised = True raised = True
assert raised assert raised
# Test that ExceptionNotRaised is raised when prop can be deleted: # Test that ExceptionNotRaised is raised when prop can be deleted:
raised = False raised = False
try: try:
tstutil.read_only(Prop('get', 'del'), 'prop') util.read_only(Prop('get', 'del'), 'prop')
except tstutil.ExceptionNotRaised: except util.ExceptionNotRaised:
raised = True raised = True
assert raised assert raised
@@ -134,15 +134,15 @@ def test_read_only():
# deleted: # deleted:
raised = False raised = False
try: try:
tstutil.read_only(Prop('get', 'del'), 'prop') util.read_only(Prop('get', 'del'), 'prop')
except tstutil.ExceptionNotRaised: except util.ExceptionNotRaised:
raised = True raised = True
assert raised assert raised
# Test that AttributeError is raised when prop can't be read: # Test that AttributeError is raised when prop can't be read:
raised = False raised = False
try: try:
tstutil.read_only(Prop(), 'prop') util.read_only(Prop(), 'prop')
except AttributeError: except AttributeError:
raised = True raised = True
assert raised assert raised