diff options
Diffstat (limited to 'tests/test_write_file.py')
-rw-r--r-- | tests/test_write_file.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_write_file.py b/tests/test_write_file.py new file mode 100644 index 0000000..003ab54 --- /dev/null +++ b/tests/test_write_file.py @@ -0,0 +1,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' |