mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
More tests
This commit is contained in:
@@ -15,10 +15,10 @@ Feature: ACME Cert Profile
|
||||
"acmeConfig": {}
|
||||
}
|
||||
"""
|
||||
Then the value response.status_code should be equal to 201
|
||||
Then the value response with jq .eab_kid should be present
|
||||
Then the value response with jq .eab_secret should be present
|
||||
Then the value response with jq .slug should be equal to {profile_slug}
|
||||
Then the value response with jq .caId should be equal to {CA_ID}
|
||||
Then the value response with jq .certificateTemplateId should be equal to {CERT_TEMPLATE_ID}
|
||||
Then the value response with jq .enrollmentTYpe should be equal to acme
|
||||
Then the value response.status_code should be equal to 200
|
||||
Then the value response with jq .certificateProfile.slug should be equal to "{profile_slug}"
|
||||
Then the value response with jq .certificateProfile.caId should be equal to "{CERT_CA_ID}"
|
||||
Then the value response with jq .certificateProfile.certificateTemplateId should be equal to "{CERT_TEMPLATE_ID}"
|
||||
Then the value response with jq .certificateProfile.enrollmentType should be equal to "acme"
|
||||
Then the value response with jq .certificateProfile.eab_kid should be present
|
||||
Then the value response with jq .certificateProfile.eab_secret should be present
|
||||
|
||||
@@ -3,6 +3,7 @@ import logging
|
||||
import re
|
||||
import threading
|
||||
|
||||
import httpx
|
||||
import jq
|
||||
import requests
|
||||
import glom
|
||||
@@ -108,6 +109,8 @@ def eval_var(context: Context, var_path: str, as_json: bool = True):
|
||||
value = value.to_json()
|
||||
elif isinstance(value, requests.Response):
|
||||
value = value.json()
|
||||
elif isinstance(value, httpx.Response):
|
||||
value = value.json()
|
||||
return value
|
||||
|
||||
|
||||
@@ -327,7 +330,7 @@ def step_impl(context: Context, var_path: str, jq_query: str, expected: str):
|
||||
var_path=var_path,
|
||||
jq_query=jq_query,
|
||||
)
|
||||
expected_value = json.loads(expected)
|
||||
expected_value = replace_vars(json.loads(expected), context.vars)
|
||||
assert result == expected_value, (
|
||||
f"{json.dumps(value)!r} with jq {jq_query!r}, the result {json.dumps(result)!r} does not match {json.dumps(expected_value)!r}"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user