Coverage for tests/simulator/test_simulator_policies.py: 100%
22 statements
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-09 04:47 +0000
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-09 04:47 +0000
2"""
3Test simulator policies.
4"""
6import sys
7import os
9# Add current path
10sys.path.append(os.getcwd())
12from tests.test_utils import temp_sys_path
14with temp_sys_path("simulator", "streamwise"):
15 from model_provisioner.policies import STREAMWISE_POLICY
16 from model_provisioner.policies import BASELINE_POLICIES
18 from sim_types import Objective
21def test_streamwise_policies() -> None:
22 policy = STREAMWISE_POLICY
23 assert policy.name == "streamwise"
24 assert policy.gpu_cost is not None
25 assert policy.objective == Objective.TTFF_COST
28def test_baseline_policies() -> None:
29 assert len(BASELINE_POLICIES) == 6
30 assert "naive" in BASELINE_POLICIES
31 assert "naive disag" in BASELINE_POLICIES
32 assert "naive ttff*cost allocator" in BASELINE_POLICIES
33 assert "naive upscaler" in BASELINE_POLICIES
34 assert "naive spot" in BASELINE_POLICIES
35 assert "naive hardware" in BASELINE_POLICIES
36 assert "fake" not in BASELINE_POLICIES