Commit 84984169 authored by Jaden Goter's avatar Jaden Goter

Improved docstrings in test_viewer and changed some assertEqual calls to assertSetEqual.

parent 18f0418e
Pipeline #174526 passed with stage
in 7 minutes and 23 seconds
......@@ -35,30 +35,30 @@ class ViewerContainerTest(common.TestCase):
return viewer_container
def test_enable_three_by_three_guidelines(self):
"""Checks that the 3x3 composition guidelines switch adds the overlay to the drawing set of the composition guidelines overlay."""
"""Checks that the 3x3 composition guidelines switch adds the corresponding drawing function to the drawing set of the composition guidelines overlay."""
viewer_container = self.setup_viewer_widget()
viewer_container.three_by_three_switch.set_active(True)
self.assertEqual(viewer_container.overlay_stack.composition_guidelines_overlay.active_guidelines,
{CompositionGuidelinesDrawingFunctions.three_by_three})
self.assertSetEqual(viewer_container.overlay_stack.composition_guidelines_overlay.active_guidelines,
{CompositionGuidelinesDrawingFunctions.three_by_three})
def test_enable_all_guidelines(self):
"""Checks that all composition guidelines switches add the overlay to the drawing set of the composition guidelines overlay at once."""
"""Checks that all composition guidelines switches add the corresponding drawing functions to the drawing set of the composition guidelines overlay at once."""
viewer_container = self.setup_viewer_widget()
viewer_container.three_by_three_switch.set_active(True)
viewer_container.diagonals_switch.set_active(True)
viewer_container.vert_horiz_center_switch.set_active(True)
self.assertEqual(viewer_container.overlay_stack.composition_guidelines_overlay.active_guidelines,
{CompositionGuidelinesDrawingFunctions.three_by_three, CompositionGuidelinesDrawingFunctions.diagonals, CompositionGuidelinesDrawingFunctions.vertical_horizontal_center})
self.assertSetEqual(viewer_container.overlay_stack.composition_guidelines_overlay.active_guidelines,
{CompositionGuidelinesDrawingFunctions.three_by_three, CompositionGuidelinesDrawingFunctions.diagonals, CompositionGuidelinesDrawingFunctions.vertical_horizontal_center})
def test_disable_three_by_three_guidelines(self):
"""Checks that toggling the 3x3 composition guidelines on and off removes the overlay to the drawing set of the composition guidelines overlay."""
"""Checks that toggling the 3x3 composition guidelines on and off removes the corresponding drawing function from the drawing set of the composition guidelines overlay."""
viewer_container = self.setup_viewer_widget()
viewer_container.three_by_three_switch.set_active(True)
viewer_container.three_by_three_switch.set_active(False)
self.assertEqual(viewer_container.overlay_stack.composition_guidelines_overlay.active_guidelines, set())
self.assertSetEqual(viewer_container.overlay_stack.composition_guidelines_overlay.active_guidelines, set())
def test_show_guidelines(self):
"""Checks that the show guidelines shortcut properly hides the guidelines overlay."""
......@@ -68,7 +68,7 @@ class ViewerContainerTest(common.TestCase):
viewer_container.vert_horiz_center_switch.set_active(True)
viewer_container.toggle_guidelines_action.activate()
self.assertEqual(viewer_container.overlay_stack.composition_guidelines_overlay.active_guidelines, set())
self.assertSetEqual(viewer_container.overlay_stack.composition_guidelines_overlay.active_guidelines, set())
def test_toggle_guidelines_shortcut(self):
"""Checks that the toggle guidelines shortcut properly toggles the composition guidelines."""
......@@ -79,10 +79,10 @@ class ViewerContainerTest(common.TestCase):
viewer_container.toggle_guidelines_action.activate()
self.assertEqual(viewer_container.three_by_three_switch.get_active(), False)
self.assertEqual(viewer_container.overlay_stack.composition_guidelines_overlay.active_guidelines, set())
self.assertSetEqual(viewer_container.overlay_stack.composition_guidelines_overlay.active_guidelines, set())
viewer_container.toggle_guidelines_action.activate()
self.assertEqual(viewer_container.three_by_three_switch.get_active(), True)
self.assertEqual(viewer_container.overlay_stack.composition_guidelines_overlay.active_guidelines,
{CompositionGuidelinesDrawingFunctions.three_by_three})
self.assertSetEqual(viewer_container.overlay_stack.composition_guidelines_overlay.active_guidelines,
{CompositionGuidelinesDrawingFunctions.three_by_three})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment