muteria.common.mix module¶
This Module implement some utility mathods used throughout the project. - The function confirm_execution is usefule to request user
confirmation before proceeding the execution of a task that is considered important to verify user certainty in proceeding. An example is the deletion of the data directory…
- The class ErrorHandler define function that are called to
terminate the execution gracefully and informativelly upon error.
- class muteria.common.mix.EnumAutoName(value)[source]¶
Bases:
EnumThis is a base class that can be used to define enums, Extend this class to generate an enum that will have the methods defined here.
- get_field_value()[source]¶
get the value of the enum field. :Example: >>> class MyEnum(EnumAutoName): … FIELD1 = “abc” … FIELD2 = 3 … >>> my = MyEnum >>> my.FIELD1.get_field_value() ‘abc’
- get_str()[source]¶
get the string representation of the enum field. :Example: >>> class MyEnum(EnumAutoName): … FIELD1 = “abc” … FIELD2 = 3 … >>> my = MyEnum >>> my.FIELD1.get_str() ‘FIELD1’
- class muteria.common.mix.ErrorHandler[source]¶
Bases:
object- classmethod assert_true(condition, err_string=None, call_location=None, ask_revert=True)[source]¶
Call this function with the parameter __file__ as location_called_from
- classmethod error_exit(err_string=None, call_location=None, error_code=1, ask_revert=True, from_assert=False)[source]¶
- error_exit_revert_repo_called = False¶
- repos_dir_manager = None¶
- class muteria.common.mix.GlobalConstants[source]¶
Bases:
object- COMMAND_FAILURE = 1¶
- COMMAND_SUCCESS = 0¶
- COMMAND_UNCERTAIN = None¶
- ELEMENT_COVERED_VERDICT = 1¶
- ELEMENT_NOTCOVERED_VERDICT = 0¶
- ELEMENT_UNCERTAIN_VERDICT = None¶
- FAIL_TEST_VERDICT = 1¶
- PASS_TEST_VERDICT = 0¶
- TEST_EXECUTION_ERROR = -1¶
- UNCERTAIN_TEST_VERDICT = None¶