Package test_suite :: Package unit_tests :: Package _lib :: Module test_arg_check :: Class Test_arg_check
[hide private]
[frames] | no frames]

Class Test_arg_check

source code


Unit tests for the functions of the 'lib.arg_check' module.

Nested Classes [hide private]

Inherited from unittest.case.TestCase: failureException

Instance Methods [hide private]
 
check_function(self, func=None, allowed_types=None, dim=None, error=None, none_error=None, can_be_empty=False)
Check the operation of the given function.
source code
 
check_validate_arg(self, allowed=[], none_elem=[], empty=[], error=None, dim=(), basic_types=[], container_types=[])
Check the operation of lib.arg_check.validate_arg().
source code
 
setUp(self)
Set up function for all tests.
source code
 
test_is_bool(self)
Test the lib.arg_check.is_bool() function.
source code
 
test_is_bool_or_bool_list(self)
Test the lib.arg_check.is_bool_or_bool_list() function.
source code
 
test_is_float(self)
Test the lib.arg_check.is_float() function.
source code
 
test_is_float_array(self)
Test the lib.arg_check.is_float_array() function.
source code
 
test_is_float_matrix(self)
Test the lib.arg_check.is_float_matrix() function.
source code
 
test_is_float_object(self)
Test the lib.arg_check.is_float_object() function.
source code
 
test_is_func(self)
Test the lib.arg_check.is_func() function.
source code
 
test_is_int(self)
Test the lib.arg_check.is_int() function.
source code
 
test_is_int_list(self)
Test the lib.arg_check.is_int_list() function.
source code
 
test_is_int_or_int_list(self)
Test the lib.arg_check.is_int_or_int_list() function.
source code
 
test_is_list(self)
Test the lib.arg_check.is_list() function.
source code
 
test_is_none(self)
Test the lib.arg_check.is_none() function.
source code
 
test_is_num(self)
Test the lib.arg_check.is_num() function.
source code
 
test_is_num_list(self)
Test the lib.arg_check.is_num_list() function.
source code
 
test_is_num_or_num_tuple(self)
Test the lib.arg_check.is_num_or_num_tuple() function.
source code
 
test_is_num_tuple(self)
Test the lib.arg_check.is_num_tuple() function.
source code
 
test_is_str(self)
Test the lib.arg_check.is_str() function.
source code
 
test_is_str_list(self)
Test the lib.arg_check.is_str_list() function.
source code
 
test_is_str_or_inst(self)
Test the lib.arg_check.is_str_or_inst() function.
source code
 
test_is_str_or_num_or_str_num_list(self)
Test the lib.arg_check.is_str_or_num_or_str_num_list() function.
source code
 
test_is_str_or_num_list(self)
Test the lib.arg_check.is_str_or_num_list() function.
source code
 
test_is_str_or_str_list(self)
Test the lib.arg_check.is_str_or_str_list() function.
source code
 
test_is_tuple(self)
Test the lib.arg_check.is_tuple() function.
source code
 
test_is_val_or_list(self)
Test the lib.arg_check.is_val_or_list() function.
source code
 
test_validate_arg_all_basic_types(self)
Test lib.arg_check.validate_arg() with basic data type-checking off.
source code
 
test_validate_arg_all_containers(self)
Test lib.arg_check.validate_arg() with container type-checking off.
source code
 
test_validate_arg_all_basic_types_and_all_containers(self)
Test lib.arg_check.validate_arg() with all type-checking off.
source code
 
test_validate_arg_bool(self)
Test lib.arg_check.validate_arg() for a basic Boolean type.
source code
 
test_validate_arg_bool_list(self)
Test lib.arg_check.validate_arg() for a list of Booleans.
source code
 
test_validate_arg_bool_list_rank2(self)
Test lib.arg_check.validate_arg() for a list of lists of Booleans.
source code
 
test_validate_arg_bool_or_bool_list(self)
Test lib.arg_check.validate_arg() for a Boolean or a list of Booleans.
source code
 
test_validate_arg_float(self)
Test lib.arg_check.validate_arg() for a basic float type.
source code
 
test_validate_arg_float_list(self)
Test lib.arg_check.validate_arg() for a list of floats.
source code
 
test_validate_arg_float_list_rank2(self)
Test lib.arg_check.validate_arg() for a list of lists of floats.
source code
 
test_validate_arg_float_or_float_list(self)
Test lib.arg_check.validate_arg() for a float or list of floats.
source code
 
test_validate_arg_func(self)
Test lib.arg_check.validate_arg() for a basic function type.
source code
 
test_validate_arg_int(self)
Test lib.arg_check.validate_arg() for a basic integer type.
source code
 
test_validate_arg_int_list(self)
Test lib.arg_check.validate_arg() for a list of integers.
source code
 
test_validate_arg_int_list_rank2(self)
Test lib.arg_check.validate_arg() for a list of lists of integers.
source code
 
test_validate_arg_int_or_int_list(self)
Test lib.arg_check.validate_arg() for a integer or a list of integers.
source code
 
test_validate_arg_list(self)
Test lib.arg_check.validate_arg() for a list of anything.
source code
 
test_validate_arg_list_or_numpy_array(self)
Test lib.arg_check.validate_arg() for a list of anything or numpy array.
source code
 
test_validate_arg_number(self)
Test lib.arg_check.validate_arg() for a number.
source code
 
test_validate_arg_number_array_rank1(self)
Test lib.arg_check.validate_arg() for a rank-1 list or numpy array of numbers.
source code
 
test_validate_arg_number_array_rank2(self)
Test lib.arg_check.validate_arg() for a rank-2 list or numpy array of numbers.
source code
 
test_validate_arg_number_array_rank3(self)
Test lib.arg_check.validate_arg() for a rank-3 list or numpy array of numbers.
source code
 
test_validate_arg_number_list(self)
Test lib.arg_check.validate_arg() for a rank-1 list of numbers.
source code
 
test_validate_arg_number_list_rank2(self)
Test lib.arg_check.validate_arg() for a rank-2 list of numbers.
source code
 
test_validate_arg_number_list_rank3(self)
Test lib.arg_check.validate_arg() for a rank-3 list of numbers.
source code
 
test_validate_arg_number_numpy_array_rank1(self)
Test lib.arg_check.validate_arg() for a rank-1 numpy array of numbers.
source code
 
test_validate_arg_number_numpy_array_rank2(self)
Test lib.arg_check.validate_arg() for a rank-2 numpy array of numbers.
source code
 
test_validate_arg_number_numpy_array_rank3(self)
Test lib.arg_check.validate_arg() for a rank-3 numpy array of numbers.
source code
 
test_validate_arg_number_or_number_tuple(self)
Test lib.arg_check.validate_arg() for a rank-1 tuple of numbers.
source code
 
test_validate_arg_number_tuple(self)
Test lib.arg_check.validate_arg() for a rank-1 tuple of numbers.
source code
 
test_validate_arg_number_tuple_rank2(self)
Test lib.arg_check.validate_arg() for a rank-2 tuple of numbers.
source code
 
test_validate_arg_number_tuple_rank3(self)
Test lib.arg_check.validate_arg() for a rank-3 tuple of numbers.
source code
 
test_validate_arg_numpy_float_array(self)
Test lib.arg_check.validate_arg() for a numpy float array.
source code
 
test_validate_arg_numpy_float_matrix(self)
Test lib.arg_check.validate_arg() for a numpy matrix of floats.
source code
 
test_validate_arg_numpy_float_rank3(self)
Test lib.arg_check.validate_arg() for a numpy rank-3 object of floats.
source code
 
test_validate_arg_numpy_int_array(self)
Test lib.arg_check.validate_arg() for a numpy int array.
source code
 
test_validate_arg_numpy_int_matrix(self)
Test lib.arg_check.validate_arg() for a numpy matrix of ints.
source code
 
test_validate_arg_numpy_int_rank3(self)
Test lib.arg_check.validate_arg() for a numpy rank-3 object of ints.
source code
 
test_validate_arg_str(self)
Test lib.arg_check.validate_arg() for a basic string type.
source code
 
test_validate_arg_str_list(self)
Test lib.arg_check.validate_arg() for a list of strings.
source code
 
test_validate_arg_str_list_rank2(self)
Test lib.arg_check.validate_arg() for a list of lists of strings.
source code
 
test_validate_arg_str_or_file_read(self)
Test lib.arg_check.validate_arg() for a string or a readable file object.
source code
 
test_validate_arg_str_or_file_write(self)
Test lib.arg_check.validate_arg() for a string or a writable file object.
source code
 
test_validate_arg_str_file_read_or_str_file_read_list(self)
Test lib.arg_check.validate_arg() for a string or a readable file object, or a list of strings or a readable file objects.
source code
 
test_validate_arg_str_file_write_or_str_file_write_list(self)
Test lib.arg_check.validate_arg() for a string or a writable file object, or a list of strings or a writable file objects.
source code
 
test_validate_arg_str_or_str_list(self)
Test lib.arg_check.validate_arg() for a string or list of strings.
source code
 
test_validate_arg_tuple(self)
Test lib.arg_check.validate_arg() for a tuple of anything.
source code

Inherited from base_classes.UnitTestCase: tearDown

Inherited from unittest.case.TestCase: __call__, __eq__, __hash__, __init__, __ne__, __repr__, __str__, addCleanup, addTypeEqualityFunc, assertAlmostEqual, assertAlmostEquals, assertDictContainsSubset, assertDictEqual, assertEqual, assertEquals, assertFalse, assertGreater, assertGreaterEqual, assertIn, assertIs, assertIsInstance, assertIsNone, assertIsNot, assertIsNotNone, assertItemsEqual, assertLess, assertLessEqual, assertListEqual, assertMultiLineEqual, assertNotAlmostEqual, assertNotAlmostEquals, assertNotEqual, assertNotEquals, assertNotIn, assertNotIsInstance, assertNotRegexpMatches, assertRaises, assertRaisesRegexp, assertRegexpMatches, assertSequenceEqual, assertSetEqual, assertTrue, assertTupleEqual, assert_, countTestCases, debug, defaultTestResult, doCleanups, fail, failIf, failIfAlmostEqual, failIfEqual, failUnless, failUnlessAlmostEqual, failUnlessEqual, failUnlessRaises, id, run, shortDescription, skipTest

Inherited from unittest.case.TestCase (private): _addSkip, _baseAssertEqual, _deprecate, _formatMessage, _getAssertEqualityFunc, _truncateMessage

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]

Inherited from unittest.case.TestCase: setUpClass, tearDownClass

Class Variables [hide private]

Inherited from unittest.case.TestCase: longMessage, maxDiff

Inherited from unittest.case.TestCase (private): _classSetupFailed, _diffThreshold

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

check_function(self, func=None, allowed_types=None, dim=None, error=None, none_error=None, can_be_empty=False)

source code 

Check the operation of the given function.

Parameters:
  • func (func) - The lib.arg_check function to check.
  • allowed_types (list of str) - A list of Python data type names that should result in the function returning True.
  • dim (list of tuples) - The 'dim' argument used in some lib.arg_check functions. This should be a list matching the length of allowed_types.
  • error (RelaxError instance) - The expected RelaxError for a normal failure.
  • none_error (RelaxError instance) - The expected RelaxError for a normal failure when can_be_none is set.
  • can_be_empty (bool) - Pass this argument onto the function if True.

check_validate_arg(self, allowed=[], none_elem=[], empty=[], error=None, dim=(), basic_types=[], container_types=[])

source code 

Check the operation of lib.arg_check.validate_arg().

Parameters:
  • allowed (list of str) - The list of Python data type names from self.objects that should result in the function returning True.
  • none_elem (list of str) - The list of Python data type names from self.objects that should result in the function returning True, when 'none_elements' is set to True.
  • empty (list of str) - The list of empty Python data type names from self.objects that should result in the function returning True, when 'can_be_empty' is set to True.
  • error (RelaxError instance) - The expected RelaxError for a normal failure.
  • dim (list of tuples) - The validate_arg() 'dim' argument.

setUp(self)

source code 

Set up function for all tests.

Overrides: unittest.case.TestCase.setUp