diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-29 04:29:29 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-29 04:29:29 +0000 |
commit | 03daa91d1c9c355f5f964095371c81d73fb9e08a (patch) | |
tree | 27af14d486bd67d828c8877c0e48a5c1ec2103c9 /ipalib/tests | |
parent | 8dc0e263dac8bf4074e48fcca593a00cadec03e0 (diff) | |
download | freeipa.git-03daa91d1c9c355f5f964095371c81d73fb9e08a.tar.gz freeipa.git-03daa91d1c9c355f5f964095371c81d73fb9e08a.tar.xz freeipa.git-03daa91d1c9c355f5f964095371c81d73fb9e08a.zip |
222: Fixed broken assertion in IPATypeError; did more work on docstrings in same
Diffstat (limited to 'ipalib/tests')
-rw-r--r-- | ipalib/tests/test_errors.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/ipalib/tests/test_errors.py b/ipalib/tests/test_errors.py index bca8d3a8..48b1b8fe 100644 --- a/ipalib/tests/test_errors.py +++ b/ipalib/tests/test_errors.py @@ -21,7 +21,7 @@ Unit tests for `ipalib.errors` module. """ -from tstutil import raises, getitem, no_set, no_del, read_only, ClassChecker +from tstutil import raises, ClassChecker from ipalib import errors @@ -38,9 +38,14 @@ class test_IPATypeError(ClassChecker): """ Tests the `errors.IPATypeError.__init__` method. """ - t = unicode - v = 'hello' - e = self.cls(t, v) - assert e.type is t - assert e.value is v - assert str(e) == 'need a %r; got %r' % (t, v) + type_ = unicode + okay = 'hello' + e = self.cls(type_, okay) + assert e.type is type_ + assert e.value is okay + assert str(e) == 'need a %r; got %r' % (type_, okay) + + # Check that AssertionError is raised when type(value) is type_: + fail = u'hello' + e = raises(AssertionError, self.cls, type_, fail) + assert str(e) == '%r is a %r' % (fail, type_) |