Testing buttons

I am writing tests for the bot but am confused about handling Buttons.

I have the following custom action which returns three buttons:

def custom_action(...):
    buttons = []
    for _ in range(...):
            title': f'{name}: {date_start.strftime("%d.%m.")} {date_type}',
            payload': f'/button_affirm{{"change_shift": "{date_start.strftime("%d.%m.")} {date_type}"'
                           f', "change_workmate":"{name}"'
                           f', "change_workmate_id":"{user_id}"}}'

    return buttons

An example of what the choices look like:

1: Maxime: 28.11. early (/button_affirm{"change_shift": "28.11. early", ...})
2: Nate:  28.11. early (/button_affirm{"change_shift": "28.11. early", ...})

My question is how can I write the user’s input in my test file when this choice comes up?