summaryrefslogtreecommitdiffstats
path: root/tests/time/test_construct.py
blob: 7d81b375dac4211f3dec0434c33031121b7fffe3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)