diff options
Diffstat (limited to 'tests/time/test_construct.py')
-rw-r--r-- | tests/time/test_construct.py | 22 |
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) |