Skip to content

Commit

Permalink
access via property
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiedemaria committed Dec 8, 2023
1 parent 76df836 commit e2aded4
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1390,22 +1390,22 @@ async def main():

def assert_context_unbound(context: RunlessOpExecutionContext):
# to assert that the context is correctly unbound after op invocation
assert context._bound_properties is None # noqa: SLF001
assert context.bound_properties is None


def assert_context_bound(context: RunlessOpExecutionContext):
# to assert that the context is correctly bound during op invocation
assert context._bound_properties is not None # noqa: SLF001
assert context.bound_properties is not None


def assert_execution_properties_cleared(context: RunlessOpExecutionContext):
# to assert that the invocation properties are reset at the beginning of op invocation
assert len(context._execution_properties.output_metadata.keys()) == 0 # noqa: SLF001
assert len(context.execution_properties.output_metadata.keys()) == 0


def assert_execution_properties_exist(context: RunlessOpExecutionContext):
# to assert that the invocation properties remain accessible after op invocation
assert len(context._execution_properties.output_metadata.keys()) > 0 # noqa: SLF001
assert len(context.execution_properties.output_metadata.keys()) > 0


def test_context_bound_state_non_generator():
Expand Down

0 comments on commit e2aded4

Please sign in to comment.