mirror of
https://github.com/wassname/pytorch-ts.git
synced 2026-07-07 00:52:36 +08:00
22 lines
478 B
Python
22 lines
478 B
Python
import pytest
|
|
import pandas as pd
|
|
|
|
from pts.dataset import ProcessStartField
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"freq, expected",
|
|
[
|
|
("B", "2019-11-01"),
|
|
("W", "2019-11-03"),
|
|
("M", "2019-11-30"),
|
|
("12M", "2019-11-30"),
|
|
("A-DEC", "2019-12-31"),
|
|
],
|
|
)
|
|
def test_process_start_field(freq, expected):
|
|
process = ProcessStartField.process
|
|
given = "2019-11-01 12:34:56"
|
|
|
|
assert process(given, freq) == pd.Timestamp(expected, freq)
|