Skip to content

dash-testing, mocking callback context, keys and multiple context data #2205

@martinschorb

Description

@martinschorb

Dear all,

I have a callback with a dynamic set of inputs.
I thus use ctx.inputs or ctx.inputs_list to capture which elements are available.

In the dash-testing documentation, it is well explained how the triggered context can be generated using context_value.set.

However, I run into the following issue:

It is not clear to me how the dictionary keys provided to context_value.set map to those of dash.callback_context.

It seems that what is shown in the example, the key triggered_inputs affects all of the ctx.triggered, ctx.triggered_prop_ids, ctx.triggered_id attributes.

  • How can I set ctx.inputs and ctx.inputs_list and their equivalents for states accordingly using context_value.set?
  • Is this currently possible?
  • In addition, is it possible to provide multiple attributes at once to context_value.set to for example set both triggered and states_list attributes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions