예제 #1
0
    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
예제 #2
0
    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
예제 #3
0
    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