summaryrefslogtreecommitdiffstats
path: root/_test/test_none.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 20:19:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 20:19:53 +0000
commite7ee850d46d54789979bf0c5244bae1825fb7149 (patch)
tree6e94ed55df9ec749682a3c792ce752d07892b968 /_test/test_none.py
parentInitial commit. (diff)
downloadpython-ruyaml-e7ee850d46d54789979bf0c5244bae1825fb7149.tar.xz
python-ruyaml-e7ee850d46d54789979bf0c5244bae1825fb7149.zip
Adding upstream version 0.91.0.upstream/0.91.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '_test/test_none.py')
-rw-r--r--_test/test_none.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/_test/test_none.py b/_test/test_none.py
new file mode 100644
index 0000000..fa81c10
--- /dev/null
+++ b/_test/test_none.py
@@ -0,0 +1,42 @@
+# coding: utf-8
+
+import pytest # NOQA
+
+from .roundtrip import round_trip_dump, round_trip_load
+
+
+class TestNone:
+ def test_dump00(self):
+ data = None
+ s = round_trip_dump(data)
+ assert s == 'null\n...\n'
+ d = round_trip_load(s)
+ assert d == data
+
+ def test_dump01(self):
+ data = None
+ s = round_trip_dump(data, explicit_end=True)
+ assert s == 'null\n...\n'
+ d = round_trip_load(s)
+ assert d == data
+
+ def test_dump02(self):
+ data = None
+ s = round_trip_dump(data, explicit_end=False)
+ assert s == 'null\n...\n'
+ d = round_trip_load(s)
+ assert d == data
+
+ def test_dump03(self):
+ data = None
+ s = round_trip_dump(data, explicit_start=True)
+ assert s == '---\n...\n'
+ d = round_trip_load(s)
+ assert d == data
+
+ def test_dump04(self):
+ data = None
+ s = round_trip_dump(data, explicit_start=True, explicit_end=False)
+ assert s == '---\n...\n'
+ d = round_trip_load(s)
+ assert d == data