-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_swot_ai_helper.py
32 lines (25 loc) · 1007 Bytes
/
test_swot_ai_helper.py
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
import unittest
from swot_ai_helper import SWOTAIHelper
class MockSWOTAIHelper(SWOTAIHelper):
def __init__(self):
pass
def suggest_swot(self, category, description):
# Mock AI behavior
suggestions = {
"strength": f"Strength: {description}",
"weakness": f"Weakness: {description}",
"opportunity": f"Opportunity: {description}",
"threat": f"Threat: {description}"
}
return suggestions.get(category.lower(), "Invalid category")
class TestSWOTAIHelper(unittest.TestCase):
def setUp(self):
self.helper = MockSWOTAIHelper()
def test_valid_category(self):
result = self.helper.suggest_swot("strength", "brand loyalty")
self.assertEqual(result, "Strength: brand loyalty")
def test_invalid_category(self):
result = self.helper.suggest_swot("unknown", "unknown aspect")
self.assertEqual(result, "Invalid category")
if __name__ == "__main__":
unittest.main()