def test_traverse_dict(self): test_two_level_dict = {"foo": {"bar": "baz"}} self.assertDictEqual( {"not_found": "nope"}, utils.traverse_dict(test_two_level_dict, "foo:bar:baz", {"not_found": "nope"}) ) self.assertEqual("baz", utils.traverse_dict(test_two_level_dict, "foo:bar", {"not_found": "not_found"}))
def test_traverse_dict(self): test_two_level_dict = {'foo': {'bar': 'baz'}} self.assertDictEqual({'not_found': 'nope'}, utils.traverse_dict(test_two_level_dict, 'foo:bar:baz', {'not_found': 'nope'})) self.assertEqual( 'baz', utils.traverse_dict(test_two_level_dict, 'foo:bar', {'not_found': 'not_found'}))
def test_traverse_dict(self): test_two_level_dict = {'foo': {'bar': 'baz'}} self.assertDictEqual( {'not_found': 'nope'}, utils.traverse_dict( test_two_level_dict, 'foo:bar:baz', {'not_found': 'nope'} ) ) self.assertEqual( 'baz', utils.traverse_dict( test_two_level_dict, 'foo:bar', {'not_found': 'not_found'} ) )