def test_fileloading(self, sample_yaml):
# Cannot use tempfile.NamedTemporaryFile because of Windows's file locks
fd, fname = tempfile.mkstemp('w')
try:
with open(fd, 'w', encoding='utf-8') as f:
ryaml.dump(sample_yaml, f)
config = ShanghaiConfiguration.from_filename(fname)
finally:
os.remove(fname)
assert config.mapping == sample_yaml
评论列表
文章目录