def _ts_to_dt_with_format(ts): return ts_to_dt_with_format(ts, ts_format=rule['timestamp_format'])
def test_ts_to_dt_with_format3(): date = datetime(2021, 7, 6, hour=0, minute=0, second=0) assert ts_to_dt_with_format(date, '') == dt('2021-7-6 00:00')
def test_ts_to_dt_with_format4(): assert ts_to_dt_with_format( '01/02/2021 12:30:00 +0900', '%d/%m/%Y %H:%M:%S %z') == dt('2021-02-01 12:30:00+09:00')
def test_ts_to_dt_with_format1(): assert ts_to_dt_with_format( '2021/02/01 12:30:00', '%Y/%m/%d %H:%M:%S') == dt('2021-02-01 12:30:00+00:00')