summaryrefslogtreecommitdiffstats
path: root/tests/test_write_file.py
blob: 003ab54512e6bf4d9604d1d4240d453a99226e7f (plain)
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'