File size: 1,525 Bytes
7885a28 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
"""Tests that the tslibs API is locked down"""
from pandas._libs import tslibs
def test_namespace():
submodules = [
"base",
"ccalendar",
"conversion",
"dtypes",
"fields",
"nattype",
"np_datetime",
"offsets",
"parsing",
"period",
"strptime",
"vectorized",
"timedeltas",
"timestamps",
"timezones",
"tzconversion",
]
api = [
"BaseOffset",
"NaT",
"NaTType",
"iNaT",
"nat_strings",
"OutOfBoundsDatetime",
"OutOfBoundsTimedelta",
"Period",
"IncompatibleFrequency",
"Resolution",
"Tick",
"Timedelta",
"dt64arr_to_periodarr",
"Timestamp",
"is_date_array_normalized",
"ints_to_pydatetime",
"normalize_i8_timestamps",
"get_resolution",
"delta_to_nanoseconds",
"ints_to_pytimedelta",
"localize_pydatetime",
"tz_convert_from_utc",
"tz_convert_from_utc_single",
"to_offset",
"tz_compare",
"is_unitless",
"astype_overflowsafe",
"get_unit_from_dtype",
"periods_per_day",
"periods_per_second",
"guess_datetime_format",
"add_overflowsafe",
"get_supported_dtype",
"is_supported_dtype",
]
expected = set(submodules + api)
names = [x for x in dir(tslibs) if not x.startswith("__")]
assert set(names) == expected
|