Muscat.Helpers.CheckTools module

CheckIntegrity(GUI: bool = False)[source]
CheckIntegrityAbsent(GUI: bool = False)[source]
CheckIntegrityPresent(GUI: bool = False)[source]
MustFailFunction(func: Callable, *args, **kwargs) None[source]
Helper function to check a call of a function raise an exception

correctly

Parameters:

func (Callable) – the function to be called, args, kwargs are the argument passed to the function

Raises:

RuntimeError – Raise un exception of the function does NOT fail (in the sens of a exception raise)

MustFailFunctionWith(exceptionType, func: Callable, *args, **kwargs) None[source]
Helper function to check a call of a function raise an exception

correctly

Parameters:

func (Callable) – the function to be called, args, kwargs are the argument passed to the function

Raises:

RuntimeError – Raise un exception of the function does NOT fail (in the sens of a exception raise)

RunListOfCheckIntegrities(toTest: List[Callable[[bool], str]], GUI: bool = False) str[source]
Execute all the functions in the list. Stop at the first error.

the functions must return “ok”, “skip” to be treated as successful function

Parameters:
  • toTest (List[Callable[[bool],str] ]) – a list of functions

  • GUI (bool, optional) – bool argument passed to every function , by default False

Returns:

“ok” if all functions are executed correctly (the return of every function is “ok”) “error…” at the first error encountered

Return type:

str

SkipTest(environnementVariableName: str) bool[source]

chef if a environnement variable is present to help the user to skip test

Parameters:

environnementVariableName (str) – the name of a environnement variable

Returns:

true if the variable is present false if absent

Return type:

bool

assert_numpy_shape(x, shape: list)[source]

ex: assert_shape(conv_input_array, [8, 3, None, None])