def test_set_horizontal_align_int(self): """ Test the horizontal_align setter with an int """ # GIVEN: A AlignmentTransitionsPage instance page = AlignmentTransitionsPage() # WHEN: The property is set page.horizontal_align = HorizontalType.Center # THEN: The combobox should be correct assert page.horizontal_combo_box.currentIndex() == 2
def test_set_horizontal_align_str(self): """ Test the horizontal_align setter with a str """ # GIVEN: A AlignmentTransitionsPage instance page = AlignmentTransitionsPage() # WHEN: The property is set page.horizontal_align = HorizontalType.to_string( HorizontalType.Justify) # THEN: The combobox should be correct assert page.horizontal_combo_box.currentIndex() == 3
def test_set_horizontal_align_exception(self): """ Test the horizontal_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='horizontal_align must either be a string or an int'): page.horizontal_align = []