def __init__(self, container: Container, filepath: str, path: str = None): content = load_from_filepath(filepath) self.path = path if path: content = sget(content, path) content = list(iterate_over_values(content)) super().__init__(container, initial_content=content)
def test_attribute(key, default, result): assert sget(sentinel, key, default) == result
def test_list_default(): assert sget([1, 2, 3], "17", "default") == "default"
def test_defaults(key, result, default): assert sget(dict_target, key, default) == result
def test_key_structure(key, result): assert sget(dict_target, key) == result
def test_simple_key(key, result): assert sget(dict_target, key) == result
def test_list_default(): assert sget([1, 2, 3], '17', 'default') == 'default'