athena.test
AssertionBuilder
Builder class for creating assertions.
Source code in athena/test.py
contains(value)
Assert that the actual value contains the given value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
Any
|
the value that should be present. |
required |
Raises:
Type | Description |
---|---|
AssertionError
|
If the actual value is not a container, or the actual value does not contain the given value. |
Source code in athena/test.py
equals(expected)
Assert equality.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
expected |
Any
|
the expected value. |
required |
Raises:
Type | Description |
---|---|
AssertionError
|
If the actual value does not equal the expected value. |
Source code in athena/test.py
is_a(value, typename=None)
Assert that the actual value is an instance of the given type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
Type
|
The type to check against. |
required |
typename |
str | None
|
The name of the type to use in the error message. |
None
|
Raises:
Type | Description |
---|---|
AssertionError
|
If the actual value is not an instance of the specified type. |
Source code in athena/test.py
is_false()
is_true()
not_equals(expected)
Assert inequality.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
expected |
Any
|
the value that the actual value should not equal. |
required |
Raises:
Type | Description |
---|---|
AssertionError
|
If the actual value equals the expected value. |
Source code in athena/test.py
athert(value)
Perform an assertion.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
The value to perform the assertion on. |
required |
Returns:
Name | Type | Description |
---|---|---|
AssertionBuilder |
AssertionBuilder
|
An AssertionBuilder initialized with the given value. |