fluidasserts package

Fluid Asserts main package.

Functions trim, reindent and parse_docstring taken from openstack/rally but were slightly modified to fit this project.

class fluidasserts.Result(risk, kind, func, func_args, func_kwargs)

Bases: object

API response class.

Default constructor.

as_dict()

Return a dict representation of the class.

Return type

dict

get_safes_number()

Return the number of incidences of all safe units.

Return type

int

get_vulns_number()

Return the number of incidences of all vulnerabilities.

Return type

int

is_closed()

Return True if the Result has CLOSED status.

Return type

bool

is_open()

Return True if the Result has OPEN status.

Return type

bool

is_unknown()

Return True if the Result has UNKNOWN status.

Return type

bool

print()

Print to stdout the results.

Return type

bool

register_stats()

Register this result stats.

Return type

bool

set_duration(duration)

Set the duration.

Return type

bool

set_message(message)

Set the message.

Return type

bool

set_safes(safes)

Set the safes.

Return type

bool

set_status(status)

Set the status.

Return type

bool

set_vulns(vulns)

Set the vulns.

Return type

bool

class fluidasserts.Unit(*, where, source=None, specific, fingerprint=None)

Bases: object

API class for a testing unit.

Default constructor.

as_dict()

Dict representation of this class.

Return type

dict

total_incidences()

Return the number of incidences in this unit.

Return type

int

fluidasserts.check_cli()

Check execution from CLI.

fluidasserts.get_module_description(package, module)

Return the module description based on the docstring.

fluidasserts.method_stats_parse_stats()

Return a nice looking METHOD_STATS.

Return type

dict

fluidasserts.method_stats_set_owner(owner)

Set the current owner of METHOD_STATS.

Return type

bool

fluidasserts.parse_docstring(docstring)

Parse the docstring into its components.

Returns

a dictionary of form {

”short_description”: …, “long_description”: …, “params”: [{“name”: …, “doc”: …}, …], “returns”: …

}

fluidasserts.reindent(string)

Reindent string.

fluidasserts.trim(docstring)

Trim function from PEP-257.

Subpackages