code quality run

This commit is contained in:
2025-09-13 21:58:54 +02:00
parent 0dfd885847
commit 3eb18ef91e
63 changed files with 1802 additions and 1289 deletions

View File

@@ -1,6 +1,7 @@
# tests/test_marketplace.py
from unittest.mock import AsyncMock, patch
import pytest
from unittest.mock import patch, AsyncMock
class TestMarketplaceAPI:
@@ -10,11 +11,12 @@ class TestMarketplaceAPI:
import_data = {
"url": "https://example.com/products.csv",
"marketplace": "TestMarket",
"shop_code": test_shop.shop_code
"shop_code": test_shop.shop_code,
}
response = client.post("/api/v1/marketplace/import-product",
headers=auth_headers, json=import_data)
response = client.post(
"/api/v1/marketplace/import-product", headers=auth_headers, json=import_data
)
assert response.status_code == 200
data = response.json()
@@ -29,11 +31,12 @@ class TestMarketplaceAPI:
import_data = {
"url": "https://example.com/products.csv",
"marketplace": "TestMarket",
"shop_code": "NONEXISTENT"
"shop_code": "NONEXISTENT",
}
response = client.post("/api/v1/marketplace/import-product",
headers=auth_headers, json=import_data)
response = client.post(
"/api/v1/marketplace/import-product", headers=auth_headers, json=import_data
)
assert response.status_code == 404
assert "Shop not found" in response.json()["detail"]
@@ -49,4 +52,3 @@ class TestMarketplaceAPI:
"""Test that marketplace endpoints require authentication"""
response = client.get("/api/v1/marketplace/import-jobs")
assert response.status_code == 401 # No authorization header