def with_unknown_extension(expect, path): with expect.raises(ValueError): formats.deserialize(path, ".xyz")
def with_empty_file(expect, path): data = formats.deserialize(path, ".toml") expect(data) == {}
def with_empty_file(expect, path): path.write_text("{}") data = formats.deserialize(path, ".json") expect(data) == {}
def with_empty_file(expect, path): data = formats.deserialize(path, '.yaml', formatter=formats.PyYAML) expect(data) == {}
def with_empty_yaml_file(expect, path): data = formats.deserialize(path, '.yaml') expect(data) == {}
def it_rejects_unknown_extensions(expect): with expect.raises(ValueError): formats.deserialize(Path(), '.xyz')