MCPcopy
hub / github.com/pandas-dev/pandas / assert_offset_equal

Function assert_offset_equal

pandas/tests/tseries/offsets/common.py:8–20  ·  view source on GitHub ↗
(offset, base, expected)

Source from the content-addressed store, hash-verified

6
7
8def assert_offset_equal(offset, base, expected):
9 actual = offset + base
10 actual_swapped = base + offset
11 actual_apply = offset._apply(base)
12 try:
13 assert actual == expected
14 assert actual_swapped == expected
15 assert actual_apply == expected
16 except AssertionError as err:
17 raise AssertionError(
18 f"\nExpected: {expected}\nActual: {actual}\nFor Offset: {offset})"
19 f"\nAt Date: {base}"
20 ) from err
21
22
23def assert_is_on_offset(offset, date, expected):

Callers 15

test_offsetMethod · 0.90
test_offsetMethod · 0.90
test_applyMethod · 0.90
test_offsetMethod · 0.90
test_offsetMethod · 0.90
test_offsetMethod · 0.90
test_offsetMethod · 0.90
test_offsetMethod · 0.90
test_offsetMethod · 0.90

Calls 1

_applyMethod · 0.45

Tested by 15

test_offsetMethod · 0.72
test_offsetMethod · 0.72
test_applyMethod · 0.72
test_offsetMethod · 0.72
test_offsetMethod · 0.72
test_offsetMethod · 0.72
test_offsetMethod · 0.72
test_offsetMethod · 0.72
test_offsetMethod · 0.72