-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_all_features.py
More file actions
261 lines (215 loc) · 8.14 KB
/
test_all_features.py
File metadata and controls
261 lines (215 loc) · 8.14 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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
#!/usr/bin/env python3
"""
Test All Advanced Features
Quick validation script for all 17 automation features
"""
import sys
from pathlib import Path
def test_imports():
"""Test that all modules can be imported."""
print("=" * 70)
print("TESTING MODULE IMPORTS")
print("=" * 70)
tests = []
# Test 1: Email Automation
try:
from ai_automation_framework.tools.advanced_automation import EmailAutomationTool
tests.append(("Email Automation", True, None))
except Exception as e:
tests.append(("Email Automation", False, str(e)))
# Test 2: Database Automation
try:
from ai_automation_framework.tools.advanced_automation import DatabaseAutomationTool
tests.append(("Database Automation", True, None))
except Exception as e:
tests.append(("Database Automation", False, str(e)))
# Test 3: Web Scraping
try:
from ai_automation_framework.tools.advanced_automation import WebScraperTool
tests.append(("Web Scraping", True, None))
except Exception as e:
tests.append(("Web Scraping", False, str(e)))
# Test 4: Task Scheduler
try:
from ai_automation_framework.tools.scheduler_and_testing import TaskScheduler
tests.append(("Task Scheduler", True, None))
except Exception as e:
tests.append(("Task Scheduler", False, str(e)))
# Test 5: API Testing
try:
from ai_automation_framework.tools.scheduler_and_testing import APITestingTool
tests.append(("API Testing", True, None))
except Exception as e:
tests.append(("API Testing", False, str(e)))
# Test 6: Excel/CSV
try:
from ai_automation_framework.tools.data_processing import ExcelAutomationTool, CSVProcessingTool
tests.append(("Excel/CSV Processing", True, None))
except Exception as e:
tests.append(("Excel/CSV Processing", False, str(e)))
# Test 7: Image Processing
try:
from ai_automation_framework.tools.media_messaging import ImageProcessingTool
tests.append(("Image Processing", True, None))
except Exception as e:
tests.append(("Image Processing", False, str(e)))
# Test 8: OCR
try:
from ai_automation_framework.tools.media_messaging import OCRTool
tests.append(("OCR", True, None))
except Exception as e:
tests.append(("OCR", False, str(e)))
# Test 9: Slack
try:
from ai_automation_framework.tools.media_messaging import SlackTool
tests.append(("Slack Integration", True, None))
except Exception as e:
tests.append(("Slack Integration", False, str(e)))
# Test 10: Discord
try:
from ai_automation_framework.tools.media_messaging import DiscordTool
tests.append(("Discord Integration", True, None))
except Exception as e:
tests.append(("Discord Integration", False, str(e)))
# Test 11: Git Automation
try:
from ai_automation_framework.tools.devops_cloud import GitAutomationTool
tests.append(("Git Automation", True, None))
except Exception as e:
tests.append(("Git Automation", False, str(e)))
# Test 12: Cloud Storage
try:
from ai_automation_framework.tools.devops_cloud import CloudStorageTool
tests.append(("Cloud Storage", True, None))
except Exception as e:
tests.append(("Cloud Storage", False, str(e)))
# Test 13: Browser Automation
try:
from ai_automation_framework.tools.devops_cloud import BrowserAutomationTool
tests.append(("Browser Automation", True, None))
except Exception as e:
tests.append(("Browser Automation", False, str(e)))
# Test 14: PDF Processing
try:
from ai_automation_framework.tools.devops_cloud import PDFAdvancedTool
tests.append(("PDF Processing", True, None))
except Exception as e:
tests.append(("PDF Processing", False, str(e)))
# Test 15: Zapier
try:
from ai_automation_framework.integrations import ZapierIntegration
tests.append(("Zapier Integration", True, None))
except Exception as e:
tests.append(("Zapier Integration", False, str(e)))
# Test 16: n8n
try:
from ai_automation_framework.integrations import N8NIntegration
tests.append(("n8n Integration", True, None))
except Exception as e:
tests.append(("n8n Integration", False, str(e)))
# Test 17: Airflow
try:
from ai_automation_framework.integrations import AirflowIntegration
tests.append(("Airflow Integration", True, None))
except Exception as e:
tests.append(("Airflow Integration", False, str(e)))
# Print results
passed = 0
failed = 0
print(f"\n{'Feature':<30} {'Status':<10}")
print("-" * 70)
for name, success, error in tests:
if success:
print(f"{name:<30} ✅ PASS")
passed += 1
else:
print(f"{name:<30} ❌ FAIL")
if error:
print(f" Error: {error[:60]}...")
failed += 1
print("-" * 70)
print(f"\nTotal: {len(tests)} features")
print(f"Passed: {passed} ({passed/len(tests)*100:.1f}%)")
print(f"Failed: {failed}")
return passed, failed
def test_basic_functionality():
"""Test basic functionality of key features."""
print("\n" + "=" * 70)
print("TESTING BASIC FUNCTIONALITY")
print("=" * 70)
# Test Database
try:
from ai_automation_framework.tools.advanced_automation import DatabaseAutomationTool
db = DatabaseAutomationTool(":memory:")
db.connect()
schema = {"id": "INTEGER PRIMARY KEY", "name": "TEXT"}
db.create_table("test", schema)
print("✅ Database: Created table successfully")
except Exception as e:
print(f"❌ Database: {e}")
# Test Web Scraper
try:
from ai_automation_framework.tools.advanced_automation import WebScraperTool
scraper = WebScraperTool()
result = scraper.fetch_url("http://example.com", timeout=5)
if result['success']:
print("✅ Web Scraper: Fetched URL successfully")
else:
print(f"❌ Web Scraper: {result.get('error')}")
except Exception as e:
print(f"❌ Web Scraper: {e}")
# Test API Testing
try:
from ai_automation_framework.tools.scheduler_and_testing import APITestingTool
tester = APITestingTool()
result = tester.test_endpoint("https://jsonplaceholder.typicode.com/posts/1", timeout=5)
if result['success']:
print(f"✅ API Testing: Tested endpoint (response time: {result['response_time']}s)")
else:
print(f"❌ API Testing: {result.get('error')}")
except Exception as e:
print(f"❌ API Testing: {e}")
def show_summary():
"""Show framework summary."""
print("\n" + "=" * 70)
print("FRAMEWORK SUMMARY")
print("=" * 70)
summary = """
📦 AI Automation Framework - Advanced Features
✨ Total Features: 17
📂 Tool Modules: 4
🔗 Integration Modules: 3
📝 Example Scripts: 7+
📚 Documentation: Complete
Categories:
• Communication & Messaging: 3 features
• Data Processing: 4 features
• Automation & Testing: 2 features
• Media Processing: 2 features
• DevOps & Cloud: 4 features
• External Integrations: 3 features
Status: ✅ Production Ready
"""
print(summary)
# Check example files
examples_dir = Path(__file__).parent / "examples" / "level4_advanced_automation"
if examples_dir.exists():
examples = list(examples_dir.glob("*.py"))
print(f"Example Scripts ({len(examples)}):")
for example in sorted(examples)[:7]:
print(f" • {example.name}")
if __name__ == "__main__":
print("\n🤖 AI AUTOMATION FRAMEWORK - FEATURE TEST\n")
# Run tests
passed, failed = test_imports()
if failed == 0:
print("\n✅ All module imports successful!")
test_basic_functionality()
else:
print(f"\n⚠️ {failed} module(s) failed to import")
print("Note: Some features may require additional dependencies")
show_summary()
print("\n" + "=" * 70)
print("TEST COMPLETE")
print("=" * 70)
sys.exit(0 if failed == 0 else 1)