File size: 1,547 Bytes
32e4bbf |
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 |
#!/usr/bin/env python3
"""
Test script to verify Worker upload functionality
"""
from cloudflare_manager import CloudflareManager, CloudflareAccount
import os
def test_upload_worker_format():
"""Test that upload_worker method has correct signature"""
print("Testing Worker upload functionality...\n")
# Create a test account (with dummy credentials)
account = CloudflareAccount(
email="test@example.com",
token="dummy-token"
)
cf = CloudflareManager(account)
# Check method exists
assert hasattr(cf, 'upload_worker'), "upload_worker method not found"
print("β upload_worker method exists")
# Check list_workers exists
assert hasattr(cf, 'list_workers'), "list_workers method not found"
print("β list_workers method exists")
# Check get_worker exists
assert hasattr(cf, 'get_worker'), "get_worker method not found"
print("β get_worker method exists")
# Check delete_worker exists
assert hasattr(cf, 'delete_worker'), "delete_worker method not found"
print("β delete_worker method exists")
# Check example worker file exists
assert os.path.exists('example_worker.js'), "example_worker.js not found"
print("β example_worker.js exists")
# Check documentation exists
assert os.path.exists('UPLOAD_FILES_GUIDE.md'), "UPLOAD_FILES_GUIDE.md not found"
print("β UPLOAD_FILES_GUIDE.md exists")
print("\nβ
All tests passed!")
if __name__ == "__main__":
test_upload_worker_format()
|