Exemplo n.º 1
0
def test_GIVEN_component_with_no_pixel_data_WHEN_editing_component_THEN_pixel_options_arent_visible(
        qtbot, template, pixel_options, off_component_with_no_pixel_data):
    pixel_options.fill_existing_entries(off_component_with_no_pixel_data)
    show_and_close_window(qtbot, template)

    assert pixel_options.no_pixels_button.isChecked()
    assert not pixel_options.pixel_options_stack.isVisible()
Exemplo n.º 2
0
def test_GIVEN_type_changed_to_scalar_WHEN_changing_attribute_THEN_value_line_edit_is_visible(
        qtbot, field_attributes_dialog):
    widget = add_array_attribute(field_attributes_dialog, qtbot)
    widget.type_changed("Scalar")
    show_and_close_window(qtbot, field_attributes_dialog)
    assert not widget.array_edit_button.isVisible()
    assert widget.attr_value_lineedit.isVisible()
Exemplo n.º 3
0
def test_UI_GIVEN_component_with_pixel_fields_WHEN_choosing_pixel_layout_THEN_single_pixel_is_selected_and_visible_by_default(
        qtbot, template, pixel_options):
    show_and_close_window(qtbot, template)

    # Check that the single grid button is checked and the pixel grid option is visible by default
    assert pixel_options.single_pixel_radio_button.isChecked()
    assert pixel_options.pixel_options_stack.isVisible()
    assert pixel_options.pixel_options_stack.currentIndex() == 0
Exemplo n.º 4
0
def test_GIVEN_component_with_a_pixel_mapping_WHEN_editing_a_component_THEN_pixel_mapping_options_are_checked_and_visible(
        qtbot, template, pixel_options, off_component_with_pixel_mapping):
    pixel_options.fill_existing_entries(off_component_with_pixel_mapping)
    show_and_close_window(qtbot, template)

    assert pixel_options.entire_shape_radio_button.isChecked()
    assert pixel_options.pixel_options_stack.isVisible()
    assert pixel_options.pixel_options_stack.currentIndex(
    ) == PIXEL_MAPPING_STACK_INDEX
Exemplo n.º 5
0
def test_GIVEN_component_with_a_pixel_grid_WHEN_editing_a_component_THEN_pixel_grid_options_are_checked_and_visible(
        qtbot, template, pixel_options, off_component_with_pixel_grid):
    pixel_options.fill_existing_entries(off_component_with_pixel_grid)
    show_and_close_window(qtbot, template)

    assert pixel_options.single_pixel_radio_button.isChecked()
    assert pixel_options.pixel_options_stack.isVisible()
    assert pixel_options.pixel_options_stack.currentIndex(
    ) == PIXEL_GRID_STACK_INDEX
def test_UI_GIVEN_valid_pixel_grid_WHEN_entering_pixel_options_THEN_changing_to_pixel_mapping_causes_validity_to_change(
    qtbot, template, pixel_options
):

    # Change the first ID
    qtbot.keyClick(pixel_options.first_id_spin_box, Qt.Key_Up)
    qtbot.keyClick(pixel_options.first_id_spin_box, Qt.Key_Up)
    show_and_close_window(qtbot, template)

    assert pixel_options._pixel_validator.unacceptable_pixel_states() == [False, False]

    # Switch to pixel mapping
    systematic_button_press(qtbot, template, pixel_options.entire_shape_radio_button)

    assert pixel_options._pixel_validator.unacceptable_pixel_states() == [False, True]