Skip to content

Commit

Permalink
Update tests for new behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
quicklizard99 committed Apr 26, 2016
1 parent 4eb138c commit 78e31d9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
7 changes: 4 additions & 3 deletions inselect/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -1437,12 +1437,13 @@ def sync_ui(self):
self.metadata_view_action.setChecked(not boxes_view_visible)
self.zoom_in_action.setEnabled(document)
self.zoom_out_action.setEnabled(document)
self.zoom_to_selection_action.setEnabled(document)
self.zoom_home_action.setEnabled(document)
self.zoom_to_selection_action.setChecked(
document and 'follow_selection' == self.boxes_view.zoom_mode
'follow_selection' == self.boxes_view.zoom_mode
)
self.zoom_to_selection_action.setEnabled(document)
self.zoom_home_action.setChecked(
document and 'whole_scene' == self.boxes_view.zoom_mode
'whole_scene' == self.boxes_view.zoom_mode
)
self.toggle_plugin_image_action.setEnabled(document)
self.show_object_grid_action.setEnabled(objects_view_visible)
Expand Down
4 changes: 2 additions & 2 deletions inselect/tests/gui/test_action_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def _test_no_document(self):
self.assertTrue(w.metadata_view_action.isEnabled())
self.assertFalse(w.zoom_in_action.isEnabled())
self.assertFalse(w.zoom_out_action.isEnabled())
self.assertFalse(w.toogle_zoom_action.isEnabled())
self.assertFalse(w.zoom_to_selection_action.isEnabled())
self.assertFalse(w.zoom_home_action.isEnabled())

def _test_document_open(self):
Expand Down Expand Up @@ -64,7 +64,7 @@ def _test_document_open(self):
self.assertTrue(w.metadata_view_action.isEnabled())
self.assertTrue(w.zoom_in_action.isEnabled())
self.assertTrue(w.zoom_out_action.isEnabled())
self.assertTrue(w.toogle_zoom_action.isEnabled())
self.assertTrue(w.zoom_to_selection_action.isEnabled())
self.assertTrue(w.zoom_home_action.isEnabled())

def test_open_and_closed(self):
Expand Down
7 changes: 4 additions & 3 deletions inselect/tests/gui/test_boxes_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_zoom_home(self):
final = w.boxes_view.absolute_zoom
self.assertEqual(initial, final)

def test_toggle_zoom(self):
def test_zoom_to_selection(self):
"Toggles between zooming in on the selected box and zooming out"
w = self.window

Expand All @@ -88,10 +88,11 @@ def test_toggle_zoom(self):
w.select_next_prev(next=True)

# Zoom in on the selected item
w.toggle_zoom()
w.zoom_to_selection()
self.assertGreater(w.boxes_view.absolute_zoom, initial)

# Zoom all the way out
w.toggle_zoom()
w.zoom_home()

final = w.boxes_view.absolute_zoom
self.assertEqual(initial, final)
Expand Down

0 comments on commit 78e31d9

Please sign in to comment.