summaryrefslogtreecommitdiffstats
path: root/tests/time/test_construct.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/time/test_construct.py')
-rw-r--r--tests/time/test_construct.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/time/test_construct.py b/tests/time/test_construct.py
new file mode 100644
index 0000000..d2d106f
--- /dev/null
+++ b/tests/time/test_construct.py
@@ -0,0 +1,20 @@
+import pendulum
+
+from ..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)