# How to mock a pattern matching input?

**URL:** <https://community.plotly.com/t/how-to-mock-a-pattern-matching-input/79355>\
**Category:** Dash Python\
**Created:** [October 16, 2023, 9:40am UTC](https://community.plotly.com/t/how-to-mock-a-pattern-matching-input/79355 "2023-10-16T09:40:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mingw64](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@mingw64](https://community.plotly.com/u/mingw64)\
**Post date:** [October 16, 2023, 9:40am UTC](https://community.plotly.com/t/how-to-mock-a-pattern-matching-input/79355/1 "2023-10-16T09:40:57Z")

</div>

Hi all,

In the [testing documentation](https://dash.plotly.com/testing) there is an example for mocking a simple button with a simple string ID.  
The example there is:  
context\_value.set(AttributeDict(\*\*{“triggered\_inputs”: [{“prop\_id”: “btn-1-ctx-example.n\_clicks”}]}))

I’m strugging with doing the same for an input that was triggered on n\_clicks but is a simple pattern matching one:  
Input({‘type’: ‘something1’, ‘something2’: ALL}, ‘n\_clicks’),

Did anyone succeed with it? I did look at some past questions but didn’t find a clear answer.

Thank you.
