Skip to content

Commit

Permalink
Merge pull request #1436 from ericdill/save-buttons-fix
Browse files Browse the repository at this point in the history
TST: Barn-door testing of SaveButtons clicks
  • Loading branch information
blink1073 committed Mar 19, 2015
2 parents 6051ff2 + 8af4373 commit e91dcba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions skimage/viewer/tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ def test_save_buttons():
timer = QtCore.QTimer()
timer.singleShot(100, QtGui.QApplication.quit)

# exercise the button clicks
sv.save_stack.click()
sv.save_file.click()

# call the save functions directly
sv.save_to_stack()
with expected_warnings(['precision loss']):
sv.save_to_file(filename)
Expand Down
4 changes: 2 additions & 2 deletions skimage/viewer/widgets/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ def save_to_stack(self):
notify(msg)

def save_to_file(self, filename=None):
if filename is None:
if not filename:
filename = dialogs.save_file_dialog()
if filename is None:
if not filename:
return
image = self.plugin.filtered_image
if image.dtype == np.bool:
Expand Down

0 comments on commit e91dcba

Please sign in to comment.