TestCtx#

class compliance_checker.base.TestCtx(category=None, description='', out_of=0, score=0, messages=None, variable=None)[source]#

Simple struct object that holds score values and messages to compile into a result

Methods

add_failure(message)

Adds a failure along with a message :rtype: None

add_pass()

Adds a pass condition :rtype: None

assert_true(test, message)

Increments score if test is true otherwise appends a message :rtype: bool :return: Boolean indicating whether test condition passed or not

to_result

Methods Summary

__init__([category, description, out_of, ...])

add_failure(message)

Adds a failure along with a message :rtype: None

add_pass()

Adds a pass condition :rtype: None

assert_true(test, message)

Increments score if test is true otherwise appends a message :rtype: bool :return: Boolean indicating whether test condition passed or not

to_result()

Methods Documentation

__init__(category=None, description='', out_of=0, score=0, messages=None, variable=None)[source]#
add_failure(message)[source]#

Adds a failure along with a message :rtype: None

add_pass()[source]#

Adds a pass condition :rtype: None

assert_true(test, message)[source]#

Increments score if test is true otherwise appends a message :rtype: bool :return: Boolean indicating whether test condition passed or not

to_result()[source]#