chore(tests): reorganize test suite and archive redundant scripts
- Moved legacy/redundant tests to tests/archive/. - Relocated root-level debug scripts to tests/integration/. - Updated tests/README.md with final organized inventory. - Cleaned up root directory from one-off reproduction scripts.
This commit is contained in:
24
tests/integration/debug_auth_dependency.py
Normal file
24
tests/integration/debug_auth_dependency.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import asyncio
|
||||
from typing import Optional
|
||||
from app.routers.dependencies_v3 import get_account_context_optional
|
||||
|
||||
async def debug_auth():
|
||||
print("--- Debugging get_account_context_optional ---")
|
||||
|
||||
API_KEY = "IDF68Em5X4HTZlswRNgepQ"
|
||||
|
||||
# Simulate Query Param
|
||||
ctx = get_account_context_optional(
|
||||
x_aether_api_key_query=API_KEY
|
||||
)
|
||||
|
||||
print(f"Auth Method: {ctx.auth_method}")
|
||||
print(f"Account ID: {ctx.account_id}")
|
||||
|
||||
if ctx.auth_method == 'guest':
|
||||
print("❌ Result: Guest (Failure)")
|
||||
else:
|
||||
print(f"✅ Result: {ctx.auth_method} (Success)")
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(debug_auth())
|
||||
34
tests/integration/test_int_permissive_mode.py
Normal file
34
tests/integration/test_int_permissive_mode.py
Normal file
@@ -0,0 +1,34 @@
|
||||
import requests
|
||||
import json
|
||||
|
||||
API_BASE = "https://dev-api.oneskyit.com/v3/crud"
|
||||
API_KEY = "IDF68Em5X4HTZlswRNgepQ"
|
||||
JOURNAL_ID = "OGQK-02-04-94"
|
||||
|
||||
# We'll try to patch this journal with an extra field that shouldn't be there
|
||||
payload = {
|
||||
"name": "Permissive Test Name",
|
||||
"unauthorized_field": "I should be ignored",
|
||||
"created_on": "2026-01-01T00:00:00" # Technical field usually forbidden
|
||||
}
|
||||
|
||||
def test_permissive_mode():
|
||||
headers = {
|
||||
"x-aether-api-key": API_KEY,
|
||||
"x-no-account-id": "bypass",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
|
||||
print("\n--- Test 1: Standard Mode (Should FAIL) ---")
|
||||
resp = requests.patch(f"{API_BASE}/journal/{JOURNAL_ID}", headers=headers, json=payload)
|
||||
print(f"Status: {resp.status_code}")
|
||||
print(f"Response: {resp.text}")
|
||||
|
||||
print("\n--- Test 2: Permissive Mode (Should SUCCEED) ---")
|
||||
headers["x-ae-ignore-extra-fields"] = "true"
|
||||
resp = requests.patch(f"{API_BASE}/journal/{JOURNAL_ID}", headers=headers, json=payload)
|
||||
print(f"Status: {resp.status_code}")
|
||||
print(f"Response: {resp.text}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_permissive_mode()
|
||||
Reference in New Issue
Block a user