-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_close_app.py
More file actions
59 lines (43 loc) · 1.63 KB
/
Copy pathtest_close_app.py
File metadata and controls
59 lines (43 loc) · 1.63 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
"""
Test script to verify close_application functionality
"""
import asyncio
import time
from open_application import close_application, open_application
async def test_close():
"""Test closing applications"""
print("=" * 60)
print("TESTING CLOSE APPLICATION FUNCTIONALITY")
print("=" * 60)
# Test 1: Try to close an app that's not running
print("\n1. Testing close on non-running app (should say not running):")
result = await close_application("notepad")
print(f" Result: {result}")
# Test 2: Open notepad and then close it
print("\n2. Opening notepad...")
result = await open_application("notepad")
print(f" Result: {result}")
await asyncio.sleep(2) # Wait for notepad to open
print("\n3. Closing notepad...")
result = await close_application("notepad")
print(f" Result: {result}")
# Test 3: Try to close calculator
print("\n4. Opening calculator...")
result = await open_application("calculator")
print(f" Result: {result}")
await asyncio.sleep(2) # Wait for calculator to open
print("\n5. Closing calculator...")
result = await close_application("calculator")
print(f" Result: {result}")
# Test 4: Test Telegram
print("\n6. Testing Telegram open/close...")
result = await open_application("telegram")
print(f" Result: {result}")
await asyncio.sleep(3)
result = await close_application("telegram")
print(f" Result: {result}")
print("\n" + "=" * 60)
print("TESTS COMPLETED")
print("=" * 60)
if __name__ == "__main__":
asyncio.run(test_close())