-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_runner.py
More file actions
executable file
·33 lines (28 loc) · 1 KB
/
Copy pathtest_runner.py
File metadata and controls
executable file
·33 lines (28 loc) · 1 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
import sys
sys.path.append('/root/telegram_drive14')
from app import app
from database import add_file, move_items, copy_items, delete_item, get_all_files
with app.app_context():
# Add a test file
add_file("test_file.txt", "mock_file_id", "root", 123, "text/plain", None)
files = get_all_files()
print(f"Files after add: {files}")
# Get the ID of the added file
file_id = None
for f in files:
if f[1] == "test_file.txt":
file_id = f[0]
break
if file_id:
# Test move
move_items([{'id': file_id, 'type': 'file'}], "root/my_renamed_folder")
files = get_all_files()
print(f"Files after move: {files}")
# Test copy
copy_items([{'id': file_id, 'type': 'file'}], "root")
files = get_all_files()
print(f"Files after copy: {files}")
# Test delete
delete_item([{'id': file_id, 'type': 'file'}], is_bulk=True)
files = get_all_files()
print(f"Files after delete: {files}")