Files
update_day/test_fix.py

25 lines
829 B
Python

import datetime
import sys
import os
# Add the current directory to the path so we can import the module
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from check_market_data import check_stock_suspended
# Test the function with a recent date
test_date = '20260115' # A date in the recent past
test_ts_code = '000001.SZ' # Test with a known stock
print(f"Testing check_stock_suspended with date: {test_date}")
print(f"Today's date: {datetime.datetime.now().strftime('%Y%m%d')}")
print("-" * 50)
# Call the function
is_suspended, suspend_dates, earliest_suspend_start = check_stock_suspended(test_ts_code, test_date)
print(f"Is suspended: {is_suspended}")
print(f"Suspend dates: {suspend_dates}")
print(f"Earliest suspend start: {earliest_suspend_start}")
print("-" * 50)
print("Test completed successfully!")