Spaces:
Sleeping
Sleeping
File size: 860 Bytes
dc42cb3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #!/usr/bin/env python3
"""Test CloudOps Environment."""
import sys
sys.path.insert(0, 'D:/scaler')
from cloud_ops_env.env.core import CloudOpsEnvironment, TASKS
from cloud_ops_env.models import Action
print("Testing CloudOps Environment...")
# Test easy task
env = CloudOpsEnvironment()
obs = env.reset(task_id='easy')
print(f"Task: {obs.task_name} ({obs.difficulty})")
print(f"Resources: {len(obs.inventory)}")
for r in obs.inventory:
print(f" - {r.id}: {r.type} @ ${r.monthly_cost}/mo")
# Test action
action = Action(message="change srv-1 to t3.small")
obs2, reward, done, info = env.step(action)
print(f"\nAfter action:")
print(f" Reward: {reward.value if hasattr(reward, 'value') else reward}")
print(f" Done: {done}")
for r in obs2.inventory:
print(f" - {r.id}: {r.type} @ ${r.monthly_cost}/mo")
print("\nEnvironment working correctly!") |