コード例 #1
0
 def with_unknown_extension(expect, path):
     with expect.raises(ValueError):
         formats.deserialize(path, ".xyz")
コード例 #2
0
 def with_empty_file(expect, path):
     data = formats.deserialize(path, ".toml")
     expect(data) == {}
コード例 #3
0
 def with_empty_file(expect, path):
     path.write_text("{}")
     data = formats.deserialize(path, ".json")
     expect(data) == {}
コード例 #4
0
 def with_empty_file(expect, path):
     data = formats.deserialize(path, '.yaml', formatter=formats.PyYAML)
     expect(data) == {}
コード例 #5
0
 def with_empty_yaml_file(expect, path):
     data = formats.deserialize(path, '.yaml')
     expect(data) == {}
コード例 #6
0
 def it_rejects_unknown_extensions(expect):
     with expect.raises(ValueError):
         formats.deserialize(Path(), '.xyz')