def test_text_input(document, comm): text = TextInput(value='ABC', name='Text:') widget = text.get_root(document, comm=comm) assert isinstance(widget, text._widget_type) assert widget.value == 'ABC' assert widget.title == 'Text:' text._comm_change({'value': 'CBA'}) assert text.value == 'CBA' text.value = 'A' assert widget.value == 'A'
def test_text_input(document, comm): text = TextInput(value='ABC', name='Text:') box = text._get_model(document, comm=comm) assert isinstance(box, WidgetBox) widget = box.children[0] assert isinstance(widget, text._widget_type) assert widget.value == 'ABC' assert widget.title == 'Text:' text._comm_change({'value': 'CBA'}) assert text.value == 'CBA' text.value = 'A' assert widget.value == 'A'