Clean all

This commit is contained in:
Fang-Pen Lin
2025-11-12 21:35:23 -08:00
parent 3742d23d60
commit 4b70f73362
3 changed files with 6 additions and 6 deletions

View File

@@ -10,7 +10,7 @@ from dotenv import load_dotenv
from faker import Faker
import logging
from features.steps.utils import clear_all_nock, restore_nock
from features.steps.utils import clean_all_nock, restore_nock
load_dotenv()
logger = logging.getLogger(__name__)
@@ -207,5 +207,5 @@ def before_all(context: Context):
def after_scenario(context: Context, scenario: typing.Any):
if hasattr(context, "web_server"):
context.web_server.shutdown_and_server_close()
clear_all_nock(context)
clean_all_nock(context)
restore_nock(context)

View File

@@ -281,10 +281,10 @@ def restore_nock(context: Context):
response.raise_for_status()
def clear_all_nock(context: Context):
def clean_all_nock(context: Context):
jwt_token = context.vars["AUTH_TOKEN"]
response = context.http_client.post(
"/api/v1/bdd-nock/clear-all",
"/api/v1/bdd-nock/clean-all",
headers=dict(authorization="Bearer {}".format(jwt_token)),
json=dict(),
)
@@ -297,5 +297,5 @@ def with_nocks(context: Context, definitions: list[dict]):
define_nock(context, definitions)
yield
finally:
clear_all_nock(context)
clean_all_nock(context)
restore_nock(context)

View File

@@ -39,7 +39,7 @@ export const registerBddNockRouter = async (server: FastifyZodProvider) => {
server.route({
method: "POST",
url: "/clear-all",
url: "/clean-all",
schema: {
response: {
200: z.object({ status: z.string() })