def test_get_parameter_value(self): my_test_parameters = { "something": { "this": [], "and_this": { "and_that": True } }, "anything": { "all_of_this": "Sure" } } self.assertEqual( True, get_parameter_value("something.and_this.and_that", my_test_parameters, False)) self.assertDictEqual( { 'something': { 'this': [], 'and_this': { 'and_that': True } }, 'anything': { 'all_of_this': 'Sure' } }, my_test_parameters) self.assertEqual( "yeha", get_parameter_value("anything.none_of_this", my_test_parameters, "yeha")) self.assertDictEqual( { 'something': { 'this': [], 'and_this': { 'and_that': True } }, 'anything': { 'all_of_this': 'Sure', 'none_of_this': 'yeha' } }, my_test_parameters)
def test_get_parameter_value(self): my_test_parameters = { "something":{ "this":[], "and_this":{ "and_that":True } }, "anything":{ "all_of_this": "Sure" } } self.assertEqual(True, get_parameter_value("something.and_this.and_that", my_test_parameters, False)) self.assertDictEqual({'something': {'this': [], 'and_this': {'and_that': True}}, 'anything': {'all_of_this': 'Sure'}}, my_test_parameters) self.assertEqual("yeha", get_parameter_value("anything.none_of_this", my_test_parameters, "yeha")) self.assertDictEqual({'something': {'this': [], 'and_this': {'and_that': True}}, 'anything': {'all_of_this': 'Sure', 'none_of_this': 'yeha'}}, my_test_parameters)
def get_value(self, key_description, default_value=None): return get_parameter_value(key_description, self.params_dic, default_value)