Allow regex for path

This commit is contained in:
Fang-Pen Lin
2025-11-12 23:02:01 -08:00
parent 3b9c881586
commit 2f8700fdcd
5 changed files with 91 additions and 3 deletions

View File

@@ -22,6 +22,7 @@ from cryptography import x509
from cryptography.x509.oid import NameOID
from cryptography.hazmat.primitives import hashes
from features.steps.utils import define_nock, clean_all_nock, restore_nock
from utils import replace_vars, with_nocks
from utils import eval_var
from utils import prepare_headers
@@ -267,6 +268,18 @@ def step_impl(context: Context, profile_var: str):
)
@given("I intercept outgoing requests")
def step_impl(context: Context):
definitions = replace_vars(json.loads(context.text), context.vars)
define_nock(context, definitions)
@then("I reset requests interceptions")
def step_impl(context: Context):
clean_all_nock(context)
restore_nock(context)
@given("I use {token_var} for authentication")
def step_impl(context: Context, token_var: str):
context.auth_token = eval_var(context, token_var)