@when('the API client sends a POST request to "/api/identities" with the following payload:')
[docs]defstep_post_identity(context:runner.Context,payload:Any)->None:# noqa: ARG001"""Sends a POST request to the REST API to create a new identity. Args: context (runner.Context): Behave context. payload (Any): The payload containing the identity fields. """msg='Step not implemented: POST request to create an identity.'raiseAssertionError(msg)
@when('the API client sends a GET request to "/api/identities/<identifier>"')
[docs]defstep_get_identity(context:runner.Context,identifier:str)->None:# noqa: ARG001"""Sends a GET request to the REST API to retrieve an identity by its identifier. Args: context (runner.Context): Behave context. identifier (str): The unique identifier of the identity. """msg='Step not implemented: GET request to retrieve an identity.'raiseAssertionError(msg)
@when('the API client sends a PUT request to "/api/identities/<identifier>" with the following payload:')
[docs]defstep_put_identity(context:runner.Context,identifier:str,payload:Any)->None:# noqa: ARG001"""Sends a PUT request to update an existing identity. Args: context (runner.Context): Behave context. identifier (str): The unique identifier of the identity. payload (Any): The payload containing the updated identity fields. """msg='Step not implemented: PUT request to update an identity.'raiseAssertionError(msg)
@when('the API client sends a DELETE request to "/api/identities/<identifier>"')
[docs]defstep_delete_identity(context:runner.Context,identifier:str)->None:# noqa: ARG001"""Sends a DELETE request to remove an identity by its identifier. Args: context (runner.Context): Behave context. identifier (str): The unique identifier of the identity. """msg='Step not implemented: DELETE request to remove an identity.'raiseAssertionError(msg)
@when('the API client sends a GET request to "/api/identities" without authentication')
[docs]defstep_get_without_auth(context:runner.Context)->None:# noqa: ARG001"""Sends a GET request to the REST API without authentication. Args: context (runner.Context): Behave context. """msg='Step not implemented: Unauthorized GET request.'raiseAssertionError(msg)
@then('the response payload should include the created identity with:')
[docs]defstep_verify_created_identity(context:runner.Context,payload:Any)->None:# noqa: ARG001"""Verifies the response payload includes the expected fields for a newly created identity. Args: context (runner.Context): Behave context. payload (Any): Expected identity fields. """msg='Step not implemented: Verify response payload for created identity.'raiseAssertionError(msg)
@then('the response payload should include the identity with:')
[docs]defstep_verify_retrieved_identity(context:runner.Context,payload:Any)->None:# noqa: ARG001"""Verifies the response payload includes the expected fields for the retrieved identity. Args: context (runner.Context): Behave context. payload (Any): Expected identity fields. """msg='Step not implemented: Verify response payload for retrieved identity.'raiseAssertionError(msg)
@given('the identity {identity} exists')
[docs]defstep_identity_exists(context:runner.Context,identity:str)->None:# noqa: ARG001"""Ensures the identity exists. Args: context (runner.Context): Behave context. identity (str): The identity name. """msg='STEP: Given the identity {identity} exists'raiseAssertionError(msg)
@when('the API client sends a GET request to "/api/identities/{identity}"')
[docs]defstep_get_identity_by_name(context:runner.Context,identity:str)->None:# noqa: ARG001"""Sends a GET request for an identity by name. Args: context (runner.Context): Behave context. identity (str): The identity name. """msg=f'STEP: When the API client sends a GET request to "/api/identities/{identity}"'raiseAssertionError(msg)
@when('the API client sends a PUT request to "/api/identities/{identity}" with the following payload:')
[docs]defstep_put_identity_by_name(context:runner.Context,identity:str,payload:Any)->None:# noqa: ARG001"""Updates an identity by name. Args: context (runner.Context): Behave context. identity (str): The identity name. payload (Any): Updated identity data. """msg=(f'STEP: When the API client sends a PUT request to "/api/identities/{identity}" with the following payload: 'f'{payload}')raiseAssertionError(msg)
@then('the response payload should include the updated identity with:')
[docs]defstep_verify_updated_identity(context:runner.Context,payload:Any)->None:# noqa: ARG001"""Verifies the response payload contains the updated identity. Args: context (runner.Context): Behave context. payload (Any): Expected updated identity data. """msg=f'STEP: Then the response payload should include the updated identity with: {payload}'raiseAssertionError(msg)
@when('the API client sends a DELETE request to "/api/identities/{identity}"')
[docs]defstep_delete_identity_by_name(context:runner.Context,identity:str)->None:# noqa: ARG001"""Deletes an identity by name. Args: context (runner.Context): Behave context. identity (str): The identity name. """msg=f'STEP: When the API client sends a DELETE request to "/api/identities/{identity}"'raiseAssertionError(msg)
@then('the identity {identity} should no longer exist')
[docs]defstep_verify_identity_deletion(context:runner.Context,identity:str)->None:# noqa: ARG001"""Checks if an identity no longer exists. Args: context (runner.Context): Behave context. identity (str): The identity name. """msg=f'STEP: Then the identity {identity} should no longer exist'raiseAssertionError(msg)