def test_widget_utils(): box = HBox() i0 = IntText() i0._ngl_name = 'i0' i1 = IntText() i1._ngl_name = 'i1' box.children = [i0, i1] assert i0 is widget_utils.get_widget_by_name(box, 'i0') assert i1 is widget_utils.get_widget_by_name(box, 'i1') box.children = [i1, i0] assert i0 is widget_utils.get_widget_by_name(box, 'i0') assert i1 is widget_utils.get_widget_by_name(box, 'i1') nt.assert_equal(widget_utils.get_widget_by_name(box, 'i100'), None)
def test_widget_utils(): box = HBox() i0 = IntText() i0._ngl_name = 'i0' i1 = IntText() i1._ngl_name = 'i1' box.children = [i0, i1] assert i0 is widget_utils.get_widget_by_name(box, 'i0') assert i1 is widget_utils.get_widget_by_name(box, 'i1') box.children = [i1, i0] assert i0 is widget_utils.get_widget_by_name(box, 'i0') assert i1 is widget_utils.get_widget_by_name(box, 'i1') assert widget_utils.get_widget_by_name(box, 'i100') is None assert widget_utils.get_widget_by_name(None, 'i100') is None