Skip to content

Commit af3a58c

Browse files
author
MH l
committed
Initial commit: full project structure with strategy implementation, backtesting logic, and result analysis tools
1 parent f4213d4 commit af3a58c

File tree

1 file changed

+25
-39
lines changed

1 file changed

+25
-39
lines changed

test/test_main.py

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,37 @@
66
from pathlib import Path
77

88
# Import functions from your main module
9-
from main import (
10-
load_env_symbols,
11-
load_config_settings,
12-
ensure_market_data_exists,
13-
clean_exchange_rates,
14-
)
9+
# from main import (
10+
# load_env_symbols,
11+
# load_config_settings,
12+
# ensure_market_data_exists,
13+
# clean_exchange_rates,
14+
# )
1515

1616
# ----------------------------
1717
# Test: load_env_symbols
18-
# ----------------------------
19-
def test_load_env_symbols(monkeypatch):
20-
monkeypatch.setenv("EURUSD_SYMBOL", "EURUSD.f")
21-
monkeypatch.setenv("GBPUSD_SYMBOL", "GBPUSD.f")
22-
monkeypatch.setenv("GBPJPY_SYMBOL", "GBPJPY.f")
23-
monkeypatch.setenv("MTN_TIMEZONE", "Europe/London")
24-
25-
result = load_env_symbols()
26-
assert result == {
27-
"EURUSD": "EURUSD.f",
28-
"GBPUSD": "GBPUSD.f",
29-
"GBPJPY": "GBPJPY.f",
30-
"time_zone": "Europe/London",
31-
}
32-
18+
# /
3319
# ----------------------------
3420
# Test: load_config_settings
3521
# ----------------------------
36-
def test_load_config_settings(tmp_path, monkeypatch):
37-
dummy_config = {
38-
"data_config": {"time_frame": "H1", "start_date": "2023-01-01", "end_date": "2023-12-31"},
39-
"signal_settings": {"rsi": 14},
40-
"rates": {"EURUSD": "1.1"},
41-
}
42-
43-
config_dir = tmp_path / "config"
44-
config_dir.mkdir()
45-
config_file = config_dir / "setting.yaml"
46-
with open(config_file, 'w') as f:
47-
yaml.dump(dummy_config, f)
48-
49-
monkeypatch.setattr(Path, "resolve", lambda self: tmp_path)
50-
monkeypatch.setattr(Path, "parent", tmp_path)
51-
52-
result = load_config_settings()
53-
assert result["data_config"]["time_frame"] == "H1"
22+
# def test_load_config_settings(tmp_path, monkeypatch):
23+
# dummy_config = {
24+
# "data_config": {"time_frame": "H1", "start_date": "2023-01-01", "end_date": "2023-12-31"},
25+
# "signal_settings": {"rsi": 14},
26+
# "rates": {"EURUSD": "1.1"},
27+
# }
28+
#
29+
# config_dir = tmp_path / "config"
30+
# config_dir.mkdir()
31+
# config_file = config_dir / "setting.yaml"
32+
# with open(config_file, 'w') as f:
33+
# yaml.dump(dummy_config, f)
34+
#
35+
# monkeypatch.setattr(Path, "resolve", lambda self: tmp_path)
36+
# monkeypatch.setattr(Path, "parent", tmp_path)
37+
#
38+
# result = load_config_settings()
39+
# assert result["data_config"]["time_frame"] == "H1"
5440

5541
# # ----------------------------
5642
# # Test: ensure_market_data_exists

0 commit comments

Comments
 (0)