Esempio n. 1
0
    def test_set_transition_direction_int(self):
        """
        Test the transition_direction setter with an int
        """
        # GIVEN: A AlignmentTransitionsPage instance
        page = AlignmentTransitionsPage()

        # WHEN: The property is set
        page.transition_direction = TransitionDirection.Horizontal

        # THEN: The combobox should be correct
        assert page.transition_direction_combo_box.currentIndex() == 0
Esempio n. 2
0
    def test_set_transition_direction_str(self):
        """
        Test the transition_direction setter with a str
        """
        # GIVEN: A AlignmentTransitionsPage instance
        page = AlignmentTransitionsPage()

        # WHEN: The property is set
        page.transition_direction = TransitionDirection.to_string(
            TransitionDirection.Vertical)

        # THEN: The combobox should be correct
        assert page.transition_direction_combo_box.currentIndex() == 1
Esempio n. 3
0
    def test_set_transition_direction_exception(self):
        """
        Test the transition_direction 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='transition_direction must either be a string or an int'
        ):
            page.transition_direction = []