forked from manavpthaker/Career-OS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_setup.py
More file actions
193 lines (165 loc) · 5.43 KB
/
test_setup.py
File metadata and controls
193 lines (165 loc) · 5.43 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#!/usr/bin/env python3
"""
Test script to validate Career-OS setup without interactive input.
"""
import json
from pathlib import Path
def test_basic_structure():
"""Test that basic directory structure is correct."""
print("🧪 Testing Career-OS Structure")
print("=" * 40)
required_dirs = [
"prompts",
"claude-code",
"templates",
"examples",
"advanced"
]
required_files = [
"README.md",
"QUICKSTART.md",
"CONTRIBUTING.md",
"requirements.txt",
".gitignore",
"LICENSE"
]
print("📁 Checking directories...")
for directory in required_dirs:
if Path(directory).exists():
print(f" ✅ {directory}/")
else:
print(f" ❌ {directory}/ MISSING")
print("\n📄 Checking files...")
for file in required_files:
if Path(file).exists():
print(f" ✅ {file}")
else:
print(f" ❌ {file} MISSING")
def test_prompts():
"""Test that prompt templates exist and are non-empty."""
print("\n🎯 Testing Prompt Templates")
print("=" * 40)
prompts = [
"prompts/01_analyze_job.md",
"prompts/02_build_narrative.md",
"prompts/03_generate_resume.md",
"prompts/04_write_cover.md",
"prompts/05_review_quality.md"
]
for prompt in prompts:
path = Path(prompt)
if path.exists():
content = path.read_text()
if len(content) > 500: # Reasonable length check
print(f" ✅ {prompt} ({len(content)} chars)")
else:
print(f" ⚠️ {prompt} (too short: {len(content)} chars)")
else:
print(f" ❌ {prompt} MISSING")
def test_templates():
"""Test that templates are valid JSON."""
print("\n📋 Testing Templates")
print("=" * 40)
template_path = Path("templates/narrative_template.json")
if template_path.exists():
try:
with open(template_path) as f:
template = json.load(f)
required_keys = [
"personal_info",
"professional_identity",
"key_achievements",
"technical_skills"
]
missing_keys = [key for key in required_keys if key not in template]
if not missing_keys:
print(f" ✅ narrative_template.json (valid JSON with required keys)")
else:
print(f" ⚠️ narrative_template.json (missing keys: {missing_keys})")
except json.JSONDecodeError as e:
print(f" ❌ narrative_template.json (invalid JSON: {e})")
else:
print(f" ❌ narrative_template.json MISSING")
def test_examples():
"""Test that examples exist and are useful."""
print("\n📚 Testing Examples")
print("=" * 40)
examples = [
"examples/sample_job_analysis/sample_job.md",
"examples/sample_job_analysis/analysis_output.md",
"examples/sample_narrative/example_narrative.json"
]
for example in examples:
path = Path(example)
if path.exists():
content = path.read_text()
if len(content) > 200:
print(f" ✅ {example}")
else:
print(f" ⚠️ {example} (content too short)")
else:
print(f" ❌ {example} MISSING")
def test_advanced_system():
"""Test that advanced system was copied correctly."""
print("\n🔧 Testing Advanced System")
print("=" * 40)
key_files = [
"advanced/README.md",
"advanced/run.py",
"advanced/requirements.txt",
"advanced/agents/",
"advanced/config/",
"advanced/knowledge/"
]
for item in key_files:
path = Path(item)
if path.exists():
if path.is_dir():
files_count = len(list(path.rglob("*")))
print(f" ✅ {item} ({files_count} files)")
else:
print(f" ✅ {item}")
else:
print(f" ❌ {item} MISSING")
def test_pii_scrubbing():
"""Test that PII was properly scrubbed."""
print("\n🧹 Testing PII Scrubbing")
print("=" * 40)
# Check a few key files for common PII patterns
test_files = [
"advanced/README.md",
"advanced/config/user_profile.yaml",
"advanced/knowledge/narrative/verified_facts.json"
]
pii_patterns = [
"Manav Thaker",
"manav@mpthaker.xyz",
"732-995-3007",
"Rahway, NJ"
]
pii_found = False
for file_path in test_files:
path = Path(file_path)
if path.exists():
content = path.read_text()
for pattern in pii_patterns:
if pattern in content:
print(f" ⚠️ PII found in {file_path}: {pattern}")
pii_found = True
if not pii_found:
print(" ✅ No obvious PII patterns found")
def main():
"""Run all tests."""
test_basic_structure()
test_prompts()
test_templates()
test_examples()
test_advanced_system()
test_pii_scrubbing()
print("\n🎉 Testing Complete!")
print("\nNext steps:")
print("1. Try the prompts: Copy prompts/01_analyze_job.md to Claude/ChatGPT")
print("2. Test automation: Run claude-code/setup_career_os.py interactively")
print("3. Explore advanced: See advanced/README.md for full orchestrator")
if __name__ == "__main__":
main()