From 2e4fbfc8ab8c08e03ec70a4eefbe1ece16578215 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Thu, 22 Jan 2026 18:59:01 -0500 Subject: [PATCH] Saving more test scripts --- tests/e2e/cleanup_test_files.py | 50 +++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tests/e2e/cleanup_test_files.py diff --git a/tests/e2e/cleanup_test_files.py b/tests/e2e/cleanup_test_files.py new file mode 100644 index 0000000..a169119 --- /dev/null +++ b/tests/e2e/cleanup_test_files.py @@ -0,0 +1,50 @@ +import requests +import json + +# Configuration +BASE_URL = "https://dev-api.oneskyit.com/v3/action/hosted_file" +API_KEY = "IDF68Em5X4HTZlswRNgepQ" +ACCOUNT_ID = "Q8lR8Ai8hx2FjbQ3C_EH1Q" +LINK_TO_TYPE = "archive_content" +LINK_TO_ID = "bZOa7CtUm0E" + +# Files to cleanup +FILE_IDS = [ + "gv6gz5aNw14", + "58l61PS8BeQ", + "cC4J7C38OCI", + "cRFg7qnn3l8", + "E0Z0Q1EVX2g", + "2R06T6yuQLw" +] + +def cleanup_files(): + print(f"--- Cleaning up Test Files via V3 Action API ---") + + headers = { + "X-Aether-API-Key": API_KEY, + "x-account-id": ACCOUNT_ID + } + + params = { + "link_to_type": LINK_TO_TYPE, + "link_to_id": LINK_TO_ID, + "rm_orphan": "true", + "method": "delete" + } + + for fid in FILE_IDS: + print(f"\nDeleting File: {fid}...") + url = f"{BASE_URL}/{fid}" + try: + response = requests.delete(url, headers=headers, params=params) + print(f"Status: {response.status_code}") + if response.status_code == 200: + print(f"✅ Result: {json.dumps(response.json()['data'], indent=2)}") + else: + print(f"❌ Failed: {response.text}") + except Exception as e: + print(f"💥 Exception: {e}") + +if __name__ == "__main__": + cleanup_files()