This commit is contained in:
@@ -39,7 +39,7 @@ class TestDocumentUpload:
|
||||
headers = {"Authorization": sample_auth_token}
|
||||
|
||||
response = test_client.post(
|
||||
"/api/documents/upload",
|
||||
"/api/v1/documents/upload",
|
||||
files=files,
|
||||
data=data,
|
||||
headers=headers
|
||||
@@ -61,7 +61,7 @@ class TestDocumentUpload:
|
||||
headers = {"Authorization": sample_auth_token}
|
||||
|
||||
response = test_client.post(
|
||||
"/api/documents/upload",
|
||||
"/api/v1/documents/upload",
|
||||
files=files,
|
||||
data=data,
|
||||
headers=headers
|
||||
@@ -80,7 +80,7 @@ class TestDocumentUpload:
|
||||
headers = {"Authorization": sample_auth_token}
|
||||
|
||||
response = test_client.post(
|
||||
"/api/documents/upload",
|
||||
"/api/v1/documents/upload",
|
||||
files=files,
|
||||
data=data,
|
||||
headers=headers
|
||||
@@ -97,7 +97,7 @@ class TestDocumentUpload:
|
||||
data = {"org_id": "test-org-123"}
|
||||
|
||||
response = test_client.post(
|
||||
"/api/documents/upload",
|
||||
"/api/v1/documents/upload",
|
||||
files=files,
|
||||
data=data
|
||||
)
|
||||
@@ -113,7 +113,7 @@ class TestDocumentUpload:
|
||||
headers = {"Authorization": "Invalid token"}
|
||||
|
||||
response = test_client.post(
|
||||
"/api/documents/upload",
|
||||
"/api/v1/documents/upload",
|
||||
files=files,
|
||||
data=data,
|
||||
headers=headers
|
||||
@@ -127,7 +127,7 @@ class TestDocumentUpload:
|
||||
headers = {"Authorization": sample_auth_token}
|
||||
|
||||
response = test_client.post(
|
||||
"/api/documents/upload",
|
||||
"/api/v1/documents/upload",
|
||||
data=data,
|
||||
headers=headers
|
||||
)
|
||||
@@ -145,7 +145,7 @@ class TestDocumentMetadata:
|
||||
headers = {"Authorization": sample_auth_token}
|
||||
|
||||
response = test_client.get(
|
||||
"/api/documents/test-doc-456",
|
||||
"/api/v1/documents/test-doc-456",
|
||||
params={"org_id": "test-org-123"},
|
||||
headers=headers
|
||||
)
|
||||
@@ -155,7 +155,7 @@ class TestDocumentMetadata:
|
||||
|
||||
def test_get_document_without_auth_returns_401(self, test_client):
|
||||
"""Test getting document without auth returns 401."""
|
||||
response = test_client.get("/api/documents/test-doc-456")
|
||||
response = test_client.get("/api/v1/documents/test-doc-456")
|
||||
|
||||
assert response.status_code == 401
|
||||
|
||||
@@ -168,7 +168,7 @@ class TestDownloadUrl:
|
||||
headers = {"Authorization": sample_auth_token}
|
||||
|
||||
response = test_client.get(
|
||||
"/api/documents/test-doc-456/download-url",
|
||||
"/api/v1/documents/test-doc-456/download-url",
|
||||
params={"org_id": "test-org-123"},
|
||||
headers=headers
|
||||
)
|
||||
@@ -178,7 +178,7 @@ class TestDownloadUrl:
|
||||
|
||||
def test_get_download_url_without_auth_returns_401(self, test_client):
|
||||
"""Test getting download URL without auth returns 401."""
|
||||
response = test_client.get("/api/documents/test-doc-456/download-url")
|
||||
response = test_client.get("/api/v1/documents/test-doc-456/download-url")
|
||||
|
||||
assert response.status_code == 401
|
||||
|
||||
@@ -195,7 +195,7 @@ class TestPDFFieldDiscovery:
|
||||
headers = {"Authorization": sample_auth_token}
|
||||
|
||||
upload_response = test_client.post(
|
||||
"/api/documents/upload",
|
||||
"/api/v1/documents/upload",
|
||||
files=files,
|
||||
data=data,
|
||||
headers=headers
|
||||
@@ -207,7 +207,7 @@ class TestPDFFieldDiscovery:
|
||||
# Get fields
|
||||
headers = {"Authorization": sample_auth_token}
|
||||
response = test_client.get(
|
||||
f"/api/documents/{document_id}/fields",
|
||||
f"/api/v1/documents/{document_id}/fields",
|
||||
params={"org_id": "test-org-123"},
|
||||
headers=headers
|
||||
)
|
||||
@@ -235,7 +235,7 @@ class TestPDFFieldDiscovery:
|
||||
headers = {"Authorization": sample_auth_token}
|
||||
|
||||
upload_response = test_client.post(
|
||||
"/api/documents/upload",
|
||||
"/api/v1/documents/upload",
|
||||
files=files,
|
||||
data=data,
|
||||
headers=headers
|
||||
@@ -247,7 +247,7 @@ class TestPDFFieldDiscovery:
|
||||
# Get fields
|
||||
headers = {"Authorization": sample_auth_token}
|
||||
response = test_client.get(
|
||||
f"/api/documents/{document_id}/fields",
|
||||
f"/api/v1/documents/{document_id}/fields",
|
||||
params={"org_id": "test-org-123"},
|
||||
headers=headers
|
||||
)
|
||||
@@ -266,7 +266,7 @@ class TestPDFFieldDiscovery:
|
||||
headers = {"Authorization": sample_auth_token}
|
||||
|
||||
upload_response = test_client.post(
|
||||
"/api/documents/upload",
|
||||
"/api/v1/documents/upload",
|
||||
files=files,
|
||||
data=data,
|
||||
headers=headers
|
||||
@@ -278,7 +278,7 @@ class TestPDFFieldDiscovery:
|
||||
# Get fields
|
||||
headers = {"Authorization": sample_auth_token}
|
||||
response = test_client.get(
|
||||
f"/api/documents/{document_id}/fields",
|
||||
f"/api/v1/documents/{document_id}/fields",
|
||||
params={"org_id": "test-org-123"},
|
||||
headers=headers
|
||||
)
|
||||
@@ -290,7 +290,7 @@ class TestPDFFieldDiscovery:
|
||||
|
||||
def test_get_pdf_fields_without_auth_returns_401(self, test_client):
|
||||
"""Test getting PDF fields without auth returns 401."""
|
||||
response = test_client.get("/api/documents/test-doc-456/fields")
|
||||
response = test_client.get("/api/v1/documents/test-doc-456/fields")
|
||||
|
||||
assert response.status_code == 401
|
||||
|
||||
@@ -303,7 +303,7 @@ class TestDocumentDeletion:
|
||||
headers = {"Authorization": sample_auth_token}
|
||||
|
||||
response = test_client.delete(
|
||||
"/api/documents/test-doc-456",
|
||||
"/api/v1/documents/test-doc-456",
|
||||
params={"org_id": "test-org-123"},
|
||||
headers=headers
|
||||
)
|
||||
@@ -313,7 +313,7 @@ class TestDocumentDeletion:
|
||||
|
||||
def test_delete_document_without_auth_returns_401(self, test_client):
|
||||
"""Test deleting document without auth returns 401."""
|
||||
response = test_client.delete("/api/documents/test-doc-456")
|
||||
response = test_client.delete("/api/v1/documents/test-doc-456")
|
||||
|
||||
assert response.status_code == 401
|
||||
|
||||
@@ -418,7 +418,7 @@ class TestCompleteWorkflow:
|
||||
headers = {"Authorization": sample_auth_token}
|
||||
|
||||
upload_response = test_client.post(
|
||||
"/api/documents/upload",
|
||||
"/api/v1/documents/upload",
|
||||
files=files,
|
||||
data=data,
|
||||
headers=headers
|
||||
@@ -430,28 +430,28 @@ class TestCompleteWorkflow:
|
||||
# Get metadata
|
||||
headers = {"Authorization": sample_auth_token}
|
||||
metadata_response = test_client.get(
|
||||
f"/api/documents/{document_id}",
|
||||
f"/api/v1/documents/{document_id}",
|
||||
params={"org_id": "test-org-123"},
|
||||
headers=headers
|
||||
)
|
||||
|
||||
# Get fields
|
||||
fields_response = test_client.get(
|
||||
f"/api/documents/{document_id}/fields",
|
||||
f"/api/v1/documents/{document_id}/fields",
|
||||
params={"org_id": "test-org-123"},
|
||||
headers=headers
|
||||
)
|
||||
|
||||
# Get download URL
|
||||
download_response = test_client.get(
|
||||
f"/api/documents/{document_id}/download-url",
|
||||
f"/api/v1/documents/{document_id}/download-url",
|
||||
params={"org_id": "test-org-123"},
|
||||
headers=headers
|
||||
)
|
||||
|
||||
# Delete document
|
||||
delete_response = test_client.delete(
|
||||
f"/api/documents/{document_id}",
|
||||
f"/api/v1/documents/{document_id}",
|
||||
params={"org_id": "test-org-123"},
|
||||
headers=headers
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user