mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 18:27:36 +00:00
More tests
This commit is contained in:
@@ -10,7 +10,7 @@ Feature: ACME Cert Profile
|
|||||||
"slug": "{profile_slug}",
|
"slug": "{profile_slug}",
|
||||||
"description": "",
|
"description": "",
|
||||||
"enrollmentType": "acme",
|
"enrollmentType": "acme",
|
||||||
"caId": "{CA_ID}",
|
"caId": "{CERT_CA_ID}",
|
||||||
"certificateTemplateId": "{CERT_TEMPLATE_ID}",
|
"certificateTemplateId": "{CERT_TEMPLATE_ID}",
|
||||||
"acmeConfig": {}
|
"acmeConfig": {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,14 +149,24 @@ def step_impl(context: Context, method: str, url: str):
|
|||||||
|
|
||||||
@when('I send a {method} request to "{url}" with JSON payload')
|
@when('I send a {method} request to "{url}" with JSON payload')
|
||||||
def step_impl(context: Context, method: str, url: str):
|
def step_impl(context: Context, method: str, url: str):
|
||||||
|
json_payload = json.loads(context.text)
|
||||||
|
json_payload = replace_vars(json_payload, context.vars)
|
||||||
|
logger.debug(
|
||||||
|
"Sending %s request to %s with JSON payload: %s",
|
||||||
|
method,
|
||||||
|
url,
|
||||||
|
json.dumps(json_payload),
|
||||||
|
)
|
||||||
response = context.http_client.request(
|
response = context.http_client.request(
|
||||||
method,
|
method,
|
||||||
url.format(**context.vars),
|
url.format(**context.vars),
|
||||||
headers=prepare_headers(context),
|
headers=prepare_headers(context),
|
||||||
json=json.loads(context.text),
|
json=json_payload,
|
||||||
)
|
)
|
||||||
context.response = response
|
context.response = response
|
||||||
context.vars["response"] = response
|
context.vars["response"] = response
|
||||||
|
logger.debug("Response status: %r", response.status_code)
|
||||||
|
logger.debug("Response JSON payload: %r", response.json())
|
||||||
|
|
||||||
|
|
||||||
@when("I have an ACME client connecting to {url}")
|
@when("I have an ACME client connecting to {url}")
|
||||||
|
|||||||
Reference in New Issue
Block a user