File: test_write_file.py

package info (click to toggle)
python-tomli-w 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,476 kB
  • sloc: python: 614; makefile: 5
file content (9 lines) | stat: -rw-r--r-- 252 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
import tomli_w


def test_dump(tmp_path):
    toml_obj = {"testing": "test\ntest"}
    path = tmp_path / "test.toml"
    with open(path, "wb") as f:
        tomli_w.dump(toml_obj, f)
    assert path.read_bytes().decode() == 'testing = "test\\ntest"\n'