Ejemplo n.º 1
0
    def test_set_vertical_align_str(self):
        """
        Test the vertical_align setter with a str
        """
        # GIVEN: A AlignmentTransitionsPage instance
        page = AlignmentTransitionsPage()

        # WHEN: The property is set
        page.vertical_align = VerticalType.to_string(VerticalType.Top)

        # THEN: The combobox should be correct
        assert page.vertical_combo_box.currentIndex() == 0
Ejemplo n.º 2
0
    def test_set_vertical_align_int(self):
        """
        Test the vertical_align setter with an int
        """
        # GIVEN: A AlignmentTransitionsPage instance
        page = AlignmentTransitionsPage()

        # WHEN: The property is set
        page.vertical_align = VerticalType.Bottom

        # THEN: The combobox should be correct
        assert page.vertical_combo_box.currentIndex() == 2
Ejemplo n.º 3
0
    def test_set_vertical_align_exception(self):
        """
        Test the vertical_align setter with something other than a str or int
        """
        # GIVEN: A AlignmentTransitionsPage instance
        page = AlignmentTransitionsPage()

        # WHEN: The property is set
        # THEN: An exception is raised
        with pytest.raises(
                TypeError,
                match='vertical_align must either be a string or an int'):
            page.vertical_align = []