-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_skills_boost_standalone.py
More file actions
85 lines (61 loc) · 2.44 KB
/
test_skills_boost_standalone.py
File metadata and controls
85 lines (61 loc) · 2.44 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env python3
"""
Standalone test for skills boost functionality.
Refactored to use BaseSkillsBoostTest for common test logic.
Run from agentrank root: python3 test_skills_boost_standalone.py
"""
import sys
import os
# Add scripts directory to path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'scripts'))
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'scripts', 'scoring', 'tests'))
from base_skills_boost_test import BaseSkillsBoostTest
import unittest
class StandaloneSkillsBoostTest(BaseSkillsBoostTest):
"""Standalone test class for skills boost functionality."""
def test_agent_with_5_skills(self):
"""Test agent with 5 skills (should get 8% boost)."""
print("\nTest 1: Agent with 5 skills (should get 8% boost)")
self.assert_boost_applied(
raw_score=50,
boosted_score=54, # 50 * 1.08 = 54
skill_count=5,
expected_multiplier=1.08
)
print(" ✅ Passed!\n")
def test_agent_with_no_skills(self):
"""Test agent with no skills (should get 0% boost)."""
print("Test 2: Agent with no skills (should get 0% boost)")
self.run_no_skills_test()
print(" ✅ Passed!\n")
def test_score_capping_at_100(self):
"""Test score capping (95 * 1.08 should cap at 100)."""
print("Test 3: Score capping (95 * 1.08 should cap at 100)")
self.run_score_capping_test()
print(" ✅ Passed!\n")
def test_all_multiplier_tiers(self):
"""Test multiplier tiers."""
print("Test 4: Multiplier tiers")
self.run_multiplier_tier_tests()
print(" ✅ All tiers correct!\n")
def main():
"""Run standalone tests."""
print("\n🧪 Testing Skills Boost Calculator...\n")
suite = unittest.TestLoader().loadTestsFromTestCase(StandaloneSkillsBoostTest)
runner = unittest.TextTestRunner(verbosity=1)
result = runner.run(suite)
if result.wasSuccessful():
print("\n✅ All tests passed! 🎉\n")
return True
else:
print(f"\n❌ {len(result.failures)} test(s) failed\n")
return False
if __name__ == "__main__":
try:
success = main()
sys.exit(0 if success else 1)
except Exception as e:
print(f"\n❌ Test failed: {e}\n")
import traceback
traceback.print_exc()
sys.exit(1)