def test_set_selected_value(self): select = Select() select.create_option("L1", "v1") option = select.create_option("L2", "v2") select.create_option("L3", "v3") select.selected_value = "v2" assert_equal("v2", select.selected_value) assert_is(option, select.selected_option) assert_true(option.selected)
def test_set_selected_value(self): select = Select() select.create_option("L1", "v1") option = select.create_option("L2", "v2") select.create_option("L3", "v3") select.selected_value = "v2" assert_equal("v2", select.selected_value) assert_is(option, select.selected_option) assert_true(option.selected)
def test_set_selected_value__value_not_found(self): select = Select() select.create_option("L1", "v1") select.create_option("L2", "v2") with assert_raises(ValueError): select.selected_value = "not-found"
def test_set_selected_value__value_not_found(self): select = Select() select.create_option("L1", "v1") select.create_option("L2", "v2") with assert_raises(ValueError): select.selected_value = "not-found"