mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
PEP 257: cleaned up docstrings in test_errors.py
This commit is contained in:
@@ -38,7 +38,7 @@ def check_TypeError(f, value, type_, name, **kw):
|
|||||||
|
|
||||||
def test_raise_TypeError():
|
def test_raise_TypeError():
|
||||||
"""
|
"""
|
||||||
Tests the `errors.raise_TypeError` function.
|
Test the `ipalib.errors.raise_TypeError` function.
|
||||||
"""
|
"""
|
||||||
f = errors.raise_TypeError
|
f = errors.raise_TypeError
|
||||||
value = 'Hello.'
|
value = 'Hello.'
|
||||||
@@ -65,7 +65,7 @@ def test_raise_TypeError():
|
|||||||
|
|
||||||
def test_check_type():
|
def test_check_type():
|
||||||
"""
|
"""
|
||||||
Tests the `errors.check_type` function.
|
Test the `ipalib.errors.check_type` function.
|
||||||
"""
|
"""
|
||||||
f = errors.check_type
|
f = errors.check_type
|
||||||
value = 'How are you?'
|
value = 'How are you?'
|
||||||
@@ -99,7 +99,7 @@ def test_check_type():
|
|||||||
|
|
||||||
def test_check_isinstance():
|
def test_check_isinstance():
|
||||||
"""
|
"""
|
||||||
Tests the `errors.check_isinstance` function.
|
Test the `ipalib.errors.check_isinstance` function.
|
||||||
"""
|
"""
|
||||||
f = errors.check_isinstance
|
f = errors.check_isinstance
|
||||||
value = 'How are you?'
|
value = 'How are you?'
|
||||||
@@ -133,16 +133,19 @@ def test_check_isinstance():
|
|||||||
|
|
||||||
class test_IPAError(ClassChecker):
|
class test_IPAError(ClassChecker):
|
||||||
"""
|
"""
|
||||||
Tests the `errors.IPAError` exception.
|
Test the `ipalib.errors.IPAError` exception.
|
||||||
"""
|
"""
|
||||||
_cls = errors.IPAError
|
_cls = errors.IPAError
|
||||||
|
|
||||||
def test_class(self):
|
def test_class(self):
|
||||||
|
"""
|
||||||
|
Test the `ipalib.errors.IPAError` exception.
|
||||||
|
"""
|
||||||
assert self.cls.__bases__ == (Exception,)
|
assert self.cls.__bases__ == (Exception,)
|
||||||
|
|
||||||
def test_init(self):
|
def test_init(self):
|
||||||
"""
|
"""
|
||||||
Tests the `errors.IPAError.__init__` method.
|
Test the `ipalib.errors.IPAError.__init__` method.
|
||||||
"""
|
"""
|
||||||
args = ('one fish', 'two fish')
|
args = ('one fish', 'two fish')
|
||||||
e = self.cls(*args)
|
e = self.cls(*args)
|
||||||
@@ -151,7 +154,7 @@ class test_IPAError(ClassChecker):
|
|||||||
|
|
||||||
def test_str(self):
|
def test_str(self):
|
||||||
"""
|
"""
|
||||||
Tests the `errors.IPAError.__str__` method.
|
Test the `ipalib.errors.IPAError.__str__` method.
|
||||||
"""
|
"""
|
||||||
f = 'The %s color is %s.'
|
f = 'The %s color is %s.'
|
||||||
class custom_error(self.cls):
|
class custom_error(self.cls):
|
||||||
@@ -164,16 +167,19 @@ class test_IPAError(ClassChecker):
|
|||||||
|
|
||||||
class test_ValidationError(ClassChecker):
|
class test_ValidationError(ClassChecker):
|
||||||
"""
|
"""
|
||||||
Tests the `errors.ValidationError` exception.
|
Test the `ipalib.errors.ValidationError` exception.
|
||||||
"""
|
"""
|
||||||
_cls = errors.ValidationError
|
_cls = errors.ValidationError
|
||||||
|
|
||||||
def test_class(self):
|
def test_class(self):
|
||||||
|
"""
|
||||||
|
Test the `ipalib.errors.ValidationError` exception.
|
||||||
|
"""
|
||||||
assert self.cls.__bases__ == (errors.IPAError,)
|
assert self.cls.__bases__ == (errors.IPAError,)
|
||||||
|
|
||||||
def test_init(self):
|
def test_init(self):
|
||||||
"""
|
"""
|
||||||
Tests the `errors.ValidationError.__init__` method.
|
Test the `ipalib.errors.ValidationError.__init__` method.
|
||||||
"""
|
"""
|
||||||
name = 'login'
|
name = 'login'
|
||||||
value = 'Whatever'
|
value = 'Whatever'
|
||||||
@@ -197,16 +203,19 @@ class test_ValidationError(ClassChecker):
|
|||||||
|
|
||||||
class test_ConversionError(ClassChecker):
|
class test_ConversionError(ClassChecker):
|
||||||
"""
|
"""
|
||||||
Tests the `errors.ConversionError` exception.
|
Test the `ipalib.errors.ConversionError` exception.
|
||||||
"""
|
"""
|
||||||
_cls = errors.ConversionError
|
_cls = errors.ConversionError
|
||||||
|
|
||||||
def test_class(self):
|
def test_class(self):
|
||||||
|
"""
|
||||||
|
Test the `ipalib.errors.ConversionError` exception.
|
||||||
|
"""
|
||||||
assert self.cls.__bases__ == (errors.ValidationError,)
|
assert self.cls.__bases__ == (errors.ValidationError,)
|
||||||
|
|
||||||
def test_init(self):
|
def test_init(self):
|
||||||
"""
|
"""
|
||||||
Tests the `errors.ConversionError.__init__` method.
|
Test the `ipalib.errors.ConversionError.__init__` method.
|
||||||
"""
|
"""
|
||||||
name = 'some_arg'
|
name = 'some_arg'
|
||||||
value = '42.0'
|
value = '42.0'
|
||||||
@@ -227,16 +236,19 @@ class test_ConversionError(ClassChecker):
|
|||||||
|
|
||||||
class test_RuleError(ClassChecker):
|
class test_RuleError(ClassChecker):
|
||||||
"""
|
"""
|
||||||
Tests the `errors.RuleError` exception.
|
Test the `ipalib.errors.RuleError` exception.
|
||||||
"""
|
"""
|
||||||
_cls = errors.RuleError
|
_cls = errors.RuleError
|
||||||
|
|
||||||
def test_class(self):
|
def test_class(self):
|
||||||
|
"""
|
||||||
|
Test the `ipalib.errors.RuleError` exception.
|
||||||
|
"""
|
||||||
assert self.cls.__bases__ == (errors.ValidationError,)
|
assert self.cls.__bases__ == (errors.ValidationError,)
|
||||||
|
|
||||||
def test_init(self):
|
def test_init(self):
|
||||||
"""
|
"""
|
||||||
Tests the `errors.RuleError.__init__` method.
|
Test the `ipalib.errors.RuleError.__init__` method.
|
||||||
"""
|
"""
|
||||||
name = 'whatever'
|
name = 'whatever'
|
||||||
value = 'The smallest weird number.'
|
value = 'The smallest weird number.'
|
||||||
@@ -255,16 +267,19 @@ class test_RuleError(ClassChecker):
|
|||||||
|
|
||||||
class test_RequirementError(ClassChecker):
|
class test_RequirementError(ClassChecker):
|
||||||
"""
|
"""
|
||||||
Tests the `errors.RequirementError` exception.
|
Test the `ipalib.errors.RequirementError` exception.
|
||||||
"""
|
"""
|
||||||
_cls = errors.RequirementError
|
_cls = errors.RequirementError
|
||||||
|
|
||||||
def test_class(self):
|
def test_class(self):
|
||||||
|
"""
|
||||||
|
Test the `ipalib.errors.RequirementError` exception.
|
||||||
|
"""
|
||||||
assert self.cls.__bases__ == (errors.ValidationError,)
|
assert self.cls.__bases__ == (errors.ValidationError,)
|
||||||
|
|
||||||
def test_init(self):
|
def test_init(self):
|
||||||
"""
|
"""
|
||||||
Tests the `errors.RequirementError.__init__` method.
|
Test the `ipalib.errors.RequirementError.__init__` method.
|
||||||
"""
|
"""
|
||||||
name = 'givenname'
|
name = 'givenname'
|
||||||
e = self.cls(name)
|
e = self.cls(name)
|
||||||
|
|||||||
Reference in New Issue
Block a user