示例#1
0
 def test_dump_file(self, tmpdir):
     tmpfile = tmpdir / 'foo.yml'
     with tmpfile.open('w', encoding='utf-8') as f:
         utils.yaml_dump([1, 2], f)
     assert tmpfile.read() == '- 1\n- 2\n'
示例#2
0
 def test_dump(self):
     assert utils.yaml_dump([1, 2]) == '- 1\n- 2\n'
示例#3
0
 def test_dump_file(self, tmpdir):
     tmpfile = tmpdir / 'foo.yml'
     with tmpfile.open('w', encoding='utf-8') as f:
         utils.yaml_dump([1, 2], f)
     assert tmpfile.read() == '- 1\n- 2\n'
示例#4
0
 def test_dump_file(self, tmp_path):
     tmpfile = tmp_path / 'foo.yml'
     tmpfile.write_text(utils.yaml_dump([1, 2]), encoding='utf-8')
     assert tmpfile.read_text() == '- 1\n- 2\n'
示例#5
0
 def test_dump(self):
     assert utils.yaml_dump([1, 2]) == '- 1\n- 2\n'