|
1 | | -import unittest |
| 1 | +from __future__ import annotations |
2 | 2 |
|
3 | | -from quant_platform_kit.common.strategies import get_strategy_component_map |
4 | | -from crypto_strategies import get_strategy_definitions |
5 | 3 | from crypto_strategies.catalog import ( |
6 | | - CRYPTO_CANONICAL_REQUIRED_INPUTS, |
7 | | - CRYPTO_LEADER_ROTATION_PROFILE, |
| 4 | + CRYPTO_BTC_DCA_PROFILE, |
| 5 | + CRYPTO_EQUITY_COMBO_PROFILE, |
8 | 6 | CRYPTO_LIVE_POOL_ROTATION_PROFILE, |
9 | | - get_strategy_definition, |
| 7 | + CRYPTO_TREND_ROTATION_PROFILE, |
| 8 | + get_runtime_enabled_profiles, |
10 | 9 | get_strategy_metadata, |
11 | 10 | ) |
12 | | -from crypto_strategies.runtime_adapters import BINANCE_PLATFORM, get_platform_runtime_adapter |
13 | 11 |
|
14 | 12 |
|
15 | | -class CatalogTest(unittest.TestCase): |
16 | | - def test_catalog_contains_crypto_live_pool_rotation(self): |
17 | | - catalog = get_strategy_definitions() |
18 | | - self.assertIn(CRYPTO_LIVE_POOL_ROTATION_PROFILE, catalog) |
19 | | - self.assertEqual(catalog[CRYPTO_LIVE_POOL_ROTATION_PROFILE].domain, "crypto") |
20 | | - self.assertEqual(catalog[CRYPTO_LIVE_POOL_ROTATION_PROFILE].supported_platforms, frozenset({"binance"})) |
21 | | - self.assertEqual(catalog[CRYPTO_LIVE_POOL_ROTATION_PROFILE].target_mode, "weight") |
22 | | - self.assertEqual(catalog[CRYPTO_LIVE_POOL_ROTATION_PROFILE].required_inputs, CRYPTO_CANONICAL_REQUIRED_INPUTS) |
| 13 | +def test_only_live_pool_rotation_remains_runtime_enabled() -> None: |
| 14 | + assert get_runtime_enabled_profiles() == frozenset({CRYPTO_LIVE_POOL_ROTATION_PROFILE}) |
| 15 | + assert get_strategy_metadata(CRYPTO_LIVE_POOL_ROTATION_PROFILE).status == "runtime_enabled" |
23 | 16 |
|
24 | | - def test_known_profile_resolves(self): |
25 | | - definition = get_strategy_definition("crypto_live_pool_rotation") |
26 | | - self.assertEqual(definition.profile, CRYPTO_LIVE_POOL_ROTATION_PROFILE) |
27 | | - component_map = get_strategy_component_map(definition) |
28 | | - core_module = component_map["core"] |
29 | | - self.assertEqual( |
30 | | - core_module.module_path, |
31 | | - "crypto_strategies.strategies.crypto_live_pool_rotation.core", |
32 | | - ) |
33 | | - rotation_module = component_map["rotation"] |
34 | | - self.assertEqual( |
35 | | - rotation_module.module_path, |
36 | | - "crypto_strategies.strategies.crypto_live_pool_rotation.rotation", |
37 | | - ) |
38 | 17 |
|
39 | | - def test_legacy_leader_rotation_profile_resolves_to_live_pool_rotation(self): |
40 | | - definition = get_strategy_definition(CRYPTO_LEADER_ROTATION_PROFILE) |
41 | | - metadata = get_strategy_metadata(CRYPTO_LEADER_ROTATION_PROFILE) |
42 | | - |
43 | | - self.assertEqual(definition.profile, CRYPTO_LIVE_POOL_ROTATION_PROFILE) |
44 | | - self.assertEqual(metadata.canonical_profile, CRYPTO_LIVE_POOL_ROTATION_PROFILE) |
45 | | - self.assertIn(CRYPTO_LEADER_ROTATION_PROFILE, metadata.aliases) |
46 | | - |
47 | | - def test_runtime_adapter_covers_canonical_inputs(self): |
48 | | - definition = get_strategy_definition(CRYPTO_LIVE_POOL_ROTATION_PROFILE) |
49 | | - adapter = get_platform_runtime_adapter(CRYPTO_LIVE_POOL_ROTATION_PROFILE, platform_id=BINANCE_PLATFORM) |
50 | | - self.assertLessEqual(definition.required_inputs, adapter.available_inputs) |
51 | | - self.assertEqual(adapter.portfolio_input_name, "portfolio_snapshot") |
52 | | - |
53 | | - |
54 | | -if __name__ == "__main__": |
55 | | - unittest.main() |
| 18 | +def test_non_live_crypto_profiles_are_not_runtime_enabled() -> None: |
| 19 | + assert get_strategy_metadata(CRYPTO_BTC_DCA_PROFILE).status == "shadow_candidate" |
| 20 | + assert get_strategy_metadata(CRYPTO_TREND_ROTATION_PROFILE).status == "research_backtest_only" |
| 21 | + assert get_strategy_metadata(CRYPTO_EQUITY_COMBO_PROFILE).status == "research_backtest_only" |
0 commit comments