summaryrefslogtreecommitdiffstats
path: root/tests/time/test_construct.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-05 10:38:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-05 10:38:34 +0000
commite3bdad36cc3a1a00c1e6772ca1c1898085ab73e0 (patch)
tree34512072a667ae716fd262e7b37e733e60fe4d89 /tests/time/test_construct.py
parentAdding upstream version 2.1.2. (diff)
downloadpendulum-83a7f839c9a467bc9d84890cf9e61ed3520cd627.tar.xz
pendulum-83a7f839c9a467bc9d84890cf9e61ed3520cd627.zip
Adding upstream version 3.0.0~a1.upstream/3.0.0_a1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/time/test_construct.py')
-rw-r--r--tests/time/test_construct.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/time/test_construct.py b/tests/time/test_construct.py
new file mode 100644
index 0000000..7d81b37
--- /dev/null
+++ b/tests/time/test_construct.py
@@ -0,0 +1,22 @@
+from __future__ import annotations
+
+import pendulum
+
+from tests.conftest import assert_time
+
+
+def test_init():
+ t = pendulum.time(12, 34, 56, 123456)
+
+ assert_time(t, 12, 34, 56, 123456)
+
+
+def test_init_with_missing_values():
+ t = pendulum.time(12, 34, 56)
+ assert_time(t, 12, 34, 56, 0)
+
+ t = pendulum.time(12, 34)
+ assert_time(t, 12, 34, 0, 0)
+
+ t = pendulum.time(12)
+ assert_time(t, 12, 0, 0, 0)