()
| 18 | |
| 19 | |
| 20 | def target(): |
| 21 | options = ['A', 'B', 'C'] |
| 22 | put_input('input', label='input') |
| 23 | put_textarea('textarea', label='textarea', rows=3, code=None, maxlength=10, minlength=20, value=None, |
| 24 | placeholder='placeholder', readonly=False, help_text='help_text') |
| 25 | put_textarea('code', label='code', rows=4, code=True, maxlength=10, minlength=20, value=None, |
| 26 | placeholder='placeholder', readonly=False, help_text='help_text') |
| 27 | put_select('select', options=options, label='Input pin widget') |
| 28 | put_select('select_multiple', options=options, label='select-multiple', multiple=True, value=None, |
| 29 | help_text='help_text') |
| 30 | put_checkbox('checkbox', options=options, label='checkbox', inline=False, value=None, help_text='help_text') |
| 31 | put_checkbox('checkbox_inline', options=options, label='checkbox_inline', inline=True, value=None, |
| 32 | help_text='help_text') |
| 33 | put_radio('radio', options=options, label='radio', inline=False, value=None, help_text='help_text') |
| 34 | put_radio('radio_inline', options=options, label='radio_inline', inline=True, value='B', help_text='help_text') |
| 35 | put_actions('actions', buttons=['action_a', 'action_b'], label='actions') |
| 36 | |
| 37 | pin_update('input', help_text='This is help text') |
| 38 | pin_update('select_multiple', value=['B', 'C']) |
| 39 | |
| 40 | pin.radio = 'B' |
| 41 | assert (yield pin['radio']) == (yield pin.radio) == 'B' |
| 42 | |
| 43 | names = ['input', 'textarea', 'code', 'select', 'select_multiple', 'checkbox', 'checkbox_inline', 'radio', |
| 44 | 'radio_inline', 'actions'] |
| 45 | values = {} |
| 46 | on_change_values = {} |
| 47 | |
| 48 | for name in names: |
| 49 | pin_on_change(name, lambda val, name=name: on_change_values.__setitem__(name, val)) |
| 50 | |
| 51 | while len(names) != len(values): |
| 52 | info = yield pin_wait_change(*names) |
| 53 | values[info['name']] = info['value'] |
| 54 | |
| 55 | for name in names: |
| 56 | assert (yield pin[name]) == values.get(name) == on_change_values.get(name) |
| 57 | put_text(name, values.get(name), on_change_values.get(name)) |
| 58 | |
| 59 | put_text(PASSED_TEXT) |
| 60 | |
| 61 | |
| 62 | def thread_target(): |
no test coverage detected
searching dependent graphs…