Files
market_intel/tests/test_move_points.py
2026-08-01 10:33:19 +08:00

19 lines
610 B
Python

from packages.domain import move_points
from packages.domain.expiry import expiry_ms_from_ymd
def test_move_points_signed():
assert move_points(3600.0, 3500.0) == 100.0
assert move_points(3400.0, 3500.0) == -100.0
assert abs(move_points(3400.0, 3500.0)) == 100.0
def test_expiry_ms_utc8():
# 260731 → 2026-07-31 08:00 UTC
ms = expiry_ms_from_ymd("260731")
from datetime import datetime, timezone
dt = datetime.fromtimestamp(ms / 1000, tz=timezone.utc)
assert dt.year == 2026 and dt.month == 7 and dt.day == 31
assert dt.hour == 8 and dt.minute == 0