eoio.utils.tests.test_dict_tools.MyDictTools

eoio.utils.tests.test_dict_tools.MyDictTools#

class eoio.utils.tests.test_dict_tools.MyDictTools(methodName='runTest')[source]#
__init__(methodName='runTest')#

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

Methods

__init__

Create an instance of the class that will use the named test method when executed.

addClassCleanup

Same as addCleanup, except the cleanup items are called even if setUpClass fails (unlike tearDownClass).

addCleanup

Add a function, with arguments, to be called when the test is completed.

addTypeEqualityFunc

Add a type specific assertEqual style function to compare a type.

assertAlmostEqual

Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero, or by comparing that the difference between the two objects is more than the given delta.

assertCountEqual

Asserts that two iterables have the same elements, the same number of times, without regard to order.

assertDictEqual

assertEqual

Fail if the two objects are unequal as determined by the '==' operator.

assertFalse

Check that the expression is false.

assertGreater

Just like self.assertTrue(a > b), but with a nicer default message.

assertGreaterEqual

Just like self.assertTrue(a >= b), but with a nicer default message.

assertIn

Just like self.assertTrue(a in b), but with a nicer default message.

assertIs

Just like self.assertTrue(a is b), but with a nicer default message.

assertIsInstance

Same as self.assertTrue(isinstance(obj, cls)), with a nicer default message.

assertIsNone

Same as self.assertTrue(obj is None), with a nicer default message.

assertIsNot

Just like self.assertTrue(a is not b), but with a nicer default message.

assertIsNotNone

Included for symmetry with assertIsNone.

assertLess

Just like self.assertTrue(a < b), but with a nicer default message.

assertLessEqual

Just like self.assertTrue(a <= b), but with a nicer default message.

assertListEqual

A list-specific equality assertion.

assertLogs

Fail unless a log message of level level or higher is emitted on logger_name or its children.

assertMultiLineEqual

Assert that two multi-line strings are equal.

assertNoLogs

Fail unless no log messages of level level or higher are emitted on logger_name or its children.

assertNotAlmostEqual

Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero, or by comparing that the difference between the two objects is less than the given delta.

assertNotEqual

Fail if the two objects are equal as determined by the '!=' operator.

assertNotIn

Just like self.assertTrue(a not in b), but with a nicer default message.

assertNotIsInstance

Included for symmetry with assertIsInstance.

assertNotRegex

Fail the test if the text matches the regular expression.

assertRaises

Fail unless an exception of class expected_exception is raised by the callable when invoked with specified positional and keyword arguments.

assertRaisesRegex

Asserts that the message in a raised exception matches a regex.

assertRegex

Fail the test unless the text matches the regular expression.

assertSequenceEqual

An equality assertion for ordered sequences (like lists and tuples).

assertSetEqual

A set-specific equality assertion.

assertTrue

Check that the expression is true.

assertTupleEqual

A tuple-specific equality assertion.

assertWarns

Fail unless a warning of class warnClass is triggered by the callable when invoked with specified positional and keyword arguments.

assertWarnsRegex

Asserts that the message in a triggered warning matches a regexp.

countTestCases

debug

Run the test without collecting errors in a TestResult

defaultTestResult

doClassCleanups

Execute all class cleanup functions.

doCleanups

Execute all cleanup functions.

enterClassContext

Same as enterContext, but class-wide.

enterContext

Enters the supplied context manager.

fail

Fail immediately, with the given message.

id

run

setUp

Hook method for setting up the test fixture before exercising it.

setUpClass

Hook method for setting up class fixture before running tests in the class.

shortDescription

Returns a one-line description of the test, or None if no description has been provided.

skipTest

Skip this test.

subTest

Return a context manager that will return the enclosed block of code in a subtest identified by the optional message and keyword parameters.

tearDown

Hook method for deconstructing the test fixture after testing it.

tearDownClass

Hook method for deconstructing the class fixture after running all tests in the class.

test_change_type_list

test_change_type_str

test_clean_dict

test_create_parent_key

test_create_parent_key_add

test_create_parent_key_add_ignore

test_create_parent_key_ignore

test_dict_merge_common_keys_level_1

test_dict_merge_common_keys_level_2

test_dict_merge_common_values

test_dict_merge_multiple_common_keys_level_1

test_dict_merge_no_common_keys

test_empty_dict

test_get_dict_path

test_get_nested_value

test_get_value_duplicate_value

test_get_value_gen

test_get_value_multiple_levels

test_get_value_multiple_values

test_get_value_nonexistent_key

test_get_value_single_value

test_key_exists_all

test_key_exists_any

test_key_exists_invalid_key

test_key_in_dict

test_key_present

test_list_keys

test_list_keys_list

test_list_keys_tag

test_make_value_key

test_multiple_keys_present_multiple_keys_dict

test_multiple_keys_present_multiple_keys_diff_levels_dict

test_multiple_keys_present_nested_list

test_multiple_keys_present_single_key_dict

test_multiple_keys_present_single_key_list

test_pop_vals

test_remove_parent_tag

test_remove_tag_basic

test_remove_tag_different_levels

test_remove_tag_in_key

test_remove_tag_key_in_dict

test_remove_tag_list_in_dict

test_remove_tag_multiple_nested_dict_in_list

test_remove_tag_nested_dict_in_list

test_remove_tag_single_list_in_dict

test_remove_tag_with_ignore

test_remove_tag_with_multiple_ignore

test_remove_tag_with_multiple_therefore_unchanged

test_remove_tag_with_none

test_replace_key_names

test_rmv_empty_dict

Attributes