Refactoring code for modular approach
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
import pytest
|
||||
import time
|
||||
|
||||
from models.database_models import Product
|
||||
|
||||
|
||||
class TestPerformance:
|
||||
def test_product_list_performance(self, client, auth_headers, db):
|
||||
@@ -22,7 +24,7 @@ class TestPerformance:
|
||||
|
||||
# Time the request
|
||||
start_time = time.time()
|
||||
response = client.get("/api/v1/products?limit=100", headers=auth_headers)
|
||||
response = client.get("/api/v1/product?limit=100", headers=auth_headers)
|
||||
end_time = time.time()
|
||||
|
||||
assert response.status_code == 200
|
||||
@@ -48,7 +50,7 @@ class TestPerformance:
|
||||
|
||||
# Time search request
|
||||
start_time = time.time()
|
||||
response = client.get("/api/v1/products?search=Searchable", headers=auth_headers)
|
||||
response = client.get("/api/v1/product?search=Searchable", headers=auth_headers)
|
||||
end_time = time.time()
|
||||
|
||||
assert response.status_code == 200
|
||||
|
||||
Reference in New Issue
Block a user