Skip to content

Commit

Permalink
feat: better debug on internal assert data prep
Browse files Browse the repository at this point in the history
  • Loading branch information
0hsn committed Oct 21, 2024
1 parent acdc4cd commit c0519d4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
24 changes: 12 additions & 12 deletions chk/modules/validate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,18 @@ def make_assertion_entry_list(assert_lst: list[dict]) -> list[AssertionEntry]:
_extra_fld = {
key: val for key, val in each_assert.items() if key in only
}

new_assertion_lst.append(
AssertionEntry(
assert_type=_assert_type,
actual=_actual,
expected=_expected,
cast_actual_to=_cast_actual_to,
extra_fields=_extra_fld,
msg_pass=_msg_pass,
msg_fail=_msg_fail,
)
ae = AssertionEntry(
assert_type=_assert_type,
actual=_actual,
expected=_expected,
cast_actual_to=_cast_actual_to,
extra_fields=_extra_fld,
msg_pass=_msg_pass,
msg_fail=_msg_fail,
)
debug(ae)

new_assertion_lst.append(ae)

return new_assertion_lst

Expand All @@ -210,7 +210,6 @@ def make_assertion_entry_list(assert_lst: list[dict]) -> list[AssertionEntry]:
def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse:
"""Call a validation document"""

r_exception: Exception | None = None
debug(file_ctx)
debug(exec_ctx)

Expand Down Expand Up @@ -238,6 +237,7 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse:

debug(variable_doc.data)

r_exception: Exception | None = None
run_rpt = RunReport()

try:
Expand Down
3 changes: 3 additions & 0 deletions chk/modules/validate/assertion_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import chk.modules.validate.assertion_function as asrt_f
from chk.infrastructure.helper import Cast
from chk.infrastructure.logging import debug
from chk.infrastructure.templating import StrTemplate
from chk.modules.validate.assertion_message import get_assert_msg_for
from chk.modules.validate.assertion_validation import AssertionEntityType
Expand Down Expand Up @@ -182,11 +183,13 @@ def test_run(assert_list: list[AssertionEntry], variables: dict) -> RunReport:
assert_item = AssertionEntryListRunner._replace_assertion_values(
assert_item, variables
)
debug(assert_item)

resp: RunDetail = AssertionEntryListRunner._prepare_test_run_result(
assert_item,
AssertionEntryListRunner._call_assertion_method(assert_item),
)
debug(resp)

run_report.add_run_detail(resp)

Expand Down

0 comments on commit c0519d4

Please # to comment.