MCPcopy Index your code
hub / github.com/python-pendulum/pendulum / test_parse_exact

Function test_parse_exact

tests/test_parsing.py:51–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49
50
51def test_parse_exact() -> None:
52 text = "2016-10-16T12:34:56.123456+01:30"
53
54 dt = pendulum.parse(text, exact=True)
55
56 assert isinstance(dt, pendulum.DateTime)
57 assert_datetime(dt, 2016, 10, 16, 12, 34, 56, 123456)
58 assert dt.offset == 5400
59
60 text = "2016-10-16"
61
62 dt = pendulum.parse(text, exact=True)
63
64 assert isinstance(dt, pendulum.Date)
65 assert_date(dt, 2016, 10, 16)
66
67 text = "12:34:56.123456"
68
69 dt = pendulum.parse(text, exact=True)
70
71 assert isinstance(dt, pendulum.Time)
72 assert_time(dt, 12, 34, 56, 123456)
73
74 text = "13:00"
75
76 dt = pendulum.parse(text, exact=True)
77
78 assert isinstance(dt, pendulum.Time)
79 assert_time(dt, 13, 0, 0)
80
81
82def test_parse_duration() -> None:

Callers

nothing calls this directly

Calls 4

assert_datetimeFunction · 0.90
assert_dateFunction · 0.90
assert_timeFunction · 0.90
parseMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…