summaryrefslogtreecommitdiffstats
path: root/tests/test_write_file.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:27:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:27:32 +0000
commit88857376d837c86ee4cbbe6ff3c9a22ab2113ffe (patch)
treeefe8d5d117c400fef855ba85e3c181cd0d4bd501 /tests/test_write_file.py
parentInitial commit. (diff)
downloadpython-tomli-w-fd3d569eafdec01529f9af7177e607be2283292d.tar.xz
python-tomli-w-fd3d569eafdec01529f9af7177e607be2283292d.zip
Adding upstream version 1.0.0.upstream/1.0.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_write_file.py')
-rw-r--r--tests/test_write_file.py9
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'