summaryrefslogtreecommitdiffstats
path: root/tests/test_invalid.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_invalid.py
parentInitial commit. (diff)
downloadpython-tomli-w-upstream/1.0.0.tar.xz
python-tomli-w-upstream/1.0.0.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_invalid.py')
-rw-r--r--tests/test_invalid.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_invalid.py b/tests/test_invalid.py
new file mode 100644
index 0000000..11aa1fd
--- /dev/null
+++ b/tests/test_invalid.py
@@ -0,0 +1,16 @@
+from datetime import time, timezone
+
+import pytest
+
+import tomli_w
+
+
+def test_invalid_type_nested():
+ with pytest.raises(TypeError):
+ tomli_w.dumps({"bytearr": bytearray()})
+
+
+def test_invalid_time():
+ offset_time = time(23, 59, 59, tzinfo=timezone.utc)
+ with pytest.raises(ValueError):
+ tomli_w.dumps({"offset time": offset_time})