arjuna.tpi.engine.asserter module¶
-
class
arjuna.tpi.engine.asserter.
Asserter
¶ Bases:
object
Arjuna’s asserter class.
It can be used directly. It is already included as an attribute for request fixture in test functions and all Guis and Gui Templates.
-
assert_equal
(obj1, obj2, msg)¶ Assert obj1 == obj2
Wrapper on unittest’s assertEqual
Parameters: - obj1 – Object of any type which supports == operator for obj2 type
- obj2 – Object meeting the above constraint
- msg – A context string explaining why this assertion was done.
-
assert_false
(obj, msg)¶ Assert obj is False.
Wrapper on unittest’s assertFalse
Parameters: - obj – Object of any type
- msg – A context string explaining why this assertion was done.
-
assert_greater
(obj1, obj2, msg)¶ Assert obj1 > obj2
Wrapper on unittest’s assertLess
Parameters: - obj1 – Object of any type which supports > operator for obj2 type
- obj2 – Object meeting the above constraint
- msg – A context string explaining why this assertion was done.
-
assert_lesser
(obj1, obj2, msg)¶ Assert obj1 < obj2
Wrapper on unittest’s assertLess
Parameters: - obj1 – Object of any type which supports < operator for obj2 type
- obj2 – Object meeting the above constraint
- msg – A context string explaining why this assertion was done.
-
assert_max
(obj, max_value, msg)¶ Asserts a maximum value for an object i.e. obj <= max_value
Wrapper on unittest’s assertLessEqual
Parameters: - obj – Object of any type which supports <= operator for min_value
- max_value – Object meeting the above constraint
- msg – A context string explaining why this assertion was done.
-
assert_min
(obj, min_value, msg)¶ Asserts a minimum value for an object i.e. obj >= min_value
Wrapper on unittest’s assertGreaterEqual
Parameters: - obj – Object of any type which supports >= operator for min_value
- min_value – Object meeting the above constraint
- msg – A context string explaining why this assertion was done.
-
assert_not_equal
(obj1, obj2, msg)¶ Assert obj1 != obj2
Wrapper on unittest’s assertNotEqual
Parameters: - obj1 – Object of any type which supports != operator for obj2 type
- obj2 – Object meeting the above constraint
- msg – A context string explaining why this assertion was done.
-
assert_true
(obj, msg)¶ Assert obj is True.
Wrapper on unittest’s assertTrue
Parameters: - obj – Object of any type
- msg – A context string explaining why this assertion was done.
-
fail
(msg)¶ Raises AssertionError with the provided message.
Parameters: msg – A context string explaining the failure.
-
-
class
arjuna.tpi.engine.asserter.
AsserterMixIn
¶ Bases:
object
Base class to add asserter property to any class which inherits from it.
-
asserter
¶ Arjuna’s Asserter object for executing assertions.
-
-
class
arjuna.tpi.engine.asserter.
IterableAsserterMixin
¶ Bases:
object
Base class for adding assertions to iterables.
Note
Use it in combination with AsserterMixIn. The child class should have _container as its attribute or property.
-
assert_empty
(*, msg)¶ Assert that there should not be any object in this iterable.
Keyword Arguments: msg – Purpose of this assertion.
-
assert_max_size
(size, *, msg)¶ Assert that the number of objects in this iterable <= provided size.
Parameters: size – Expected maximum number of objects. Keyword Arguments: msg – Purpose of this assertion.
-
assert_min_size
(size, *, msg)¶ Assert that the number of objects in this iterable >= provided size.
Parameters: size – Expected minimum number of objects. Keyword Arguments: msg – Purpose of this assertion.
-
assert_not_empty
(*, msg)¶ Assert that there should be atleast one object in this iterable.
Keyword Arguments: msg – Purpose of this assertion.
-
assert_size
(size, *, msg)¶ Assert that the number of objects in this iterable should match provided size.
Parameters: size – Expected number of objects. Keyword Arguments: msg – Purpose of this assertion.
-
assert_size_range
(min_size, max_size, *, msg)¶ Assert that the number of objects in this iterable should be in the provided size range.
Parameters: - min_size – Expected minimum number of objects.
- max_size – Expected maximum number of objects.
Keyword Arguments: msg – Purpose of this assertion.
-
is_empty
()¶ Returns True if this iterable has no objects.
-