|
6 | 6 | from pathlib import Path |
7 | 7 |
|
8 | 8 | # 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 | +# ) |
15 | 15 |
|
16 | 16 | # ---------------------------- |
17 | 17 | # 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 | +# / |
33 | 19 | # ---------------------------- |
34 | 20 | # Test: load_config_settings |
35 | 21 | # ---------------------------- |
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" |
54 | 40 |
|
55 | 41 | # # ---------------------------- |
56 | 42 | # # Test: ensure_market_data_exists |
|
0 commit comments