def test_init_from_param(self, qtbot, default_value): # set up BooleanInput bool_param = BooleanParameter('potato', default=default_value) bool_input = BooleanInput(bool_param) qtbot.addWidget(bool_input) # test assert bool_input.text() == bool_param.name assert bool_input.value() == default_value
def test_init_from_param(self, qtbot, default_value, value_remains_default): # set up BooleanInput bool_param = BooleanParameter('potato', default=default_value) if (value_remains_default): # Enable check that the value is initialized to default_value check_value = default_value else: # Set to a non default value bool_param.value = not default_value # Enable check that the value is changed after initialization to a non default value check_value = not default_value bool_input = BooleanInput(bool_param) qtbot.addWidget(bool_input) # test assert bool_input.text() == bool_param.name assert bool_input.value() == check_value