umami.tests.unit.helper_tools package#
Submodules#
umami.tests.unit.helper_tools.test_classification_tools module#
Unit test script for the classification helper functions.
- class umami.tests.unit.helper_tools.test_classification_tools.GetClassTestCase(methodName='runTest')#
Bases:
TestCase
Test class for the get_class_labels method.
- setUp()#
Hook method for setting up the test fixture before exercising it.
- test_get_class_label_variables_3_classes()#
Get the class labels for 3 classes.
- test_get_class_label_variables_4_classes()#
Get the class labels for 4 classes.
- test_get_class_prob_var_names_3_classes()#
Test the class prob var names for 3 classes.
- test_get_class_prob_var_names_4_classes()#
Test the class prob var names for 4 classes.
- test_get_cut_list_3_classes()#
Get the class labels for 4 classes.
- test_get_cut_list_4_classes()#
Get the class labels for 4 classes.
umami.tests.unit.helper_tools.test_histogram_tools module#
Unit test script for the histogram helper functions.
- class umami.tests.unit.helper_tools.test_histogram_tools.HistRatioTestCase(methodName='runTest')#
Bases:
TestCase
Test class for hist_ratio function.
- setUp()#
Hook method for setting up the test fixture before exercising it.
- test_hist_not_same_length_denomiantor_and_unc()#
Test raise of error of shape differences between denominator and denominator uncertainty
- test_hist_not_same_length_nomiantor_and_unc()#
Test raise of error of shape differences between numerator and numerator uncertainty
- test_hist_not_same_length_nominator_denominator()#
Test raise of error when numerator and denominator have different shapes.
- test_hist_ratio()#
Test hist ratio calculation.
- class umami.tests.unit.helper_tools.test_histogram_tools.HistWUncTestCase(methodName='runTest')#
Bases:
TestCase
Test class for the hist_w_unc function.
- setUp()#
Hook method for setting up the test fixture before exercising it.
- test_hist_w_unc_normed()#
Test normed case.
- test_hist_w_unc_not_normed()#
Test the non-normed case.
- test_hist_w_unc_zero_case()#
Test the zero case for empty arrays.
- class umami.tests.unit.helper_tools.test_histogram_tools.SaveDivideTestCase(methodName='runTest')#
Bases:
TestCase
Test class for the save_divide function.
- test_denominator_float()#
Test float denominator.
- test_half_case()#
Test half divide.
- test_numerator_float()#
Test numerator float.
- test_ones_case()#
Test one divide.
- test_zero_case()#
Test zero divide.
umami.tests.unit.helper_tools.test_tools module#
Unit test the little helper functions from umami_tools.
- class umami.tests.unit.helper_tools.test_tools.CheckMainClassInputTestCase(methodName='runTest')#
Bases:
TestCase
Testing the check function for the main class.
- setUp() None #
Set up the needed variables.
- test_check_main_class_input_fail()#
Test the behaviour for a wrong type.
- test_check_main_class_input_list()#
Test the behaviour for list.
- test_check_main_class_input_set()#
Test the behaviour for set.
- test_check_main_class_input_str()#
Test the behaviour for strings.
- class umami.tests.unit.helper_tools.test_tools.ReplaceLineInFileTestCase(methodName='runTest')#
Bases:
TestCase
Testing the replaceLineInFile function.
- load_file()#
Helper function to load yaml file.
- Returns:
dict with yaml file.
- Return type:
dict
- setUp() None #
Set up the needed files.
- test_line() None #
Test the standard behaviour of the function.
- test_line_fail() None #
Test the raise error behaviour of the function.
- test_multiple_lines() None #
Test the standard behaviour of the function.
- test_multiple_lines_fail() None #
Test the raise error behaviour of the function.
- umami.tests.unit.helper_tools.test_tools.test_compare_leading_spaces(input: tuple, expected_result: int) None #
Test different scenarios for compare_leading_spaces function.
- Parameters:
input (tuple) – string tuples to test
expected_result (int) – expected result