Merge pull request #1436 from ericdill/save-buttons-fix

TST: Barn-door testing of SaveButtons clicks
This commit is contained in:
Steven Silvester
2015-03-19 14:20:09 -05:00
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -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)
+2 -2
View File
@@ -80,9 +80,9 @@ class SaveButtons(BaseWidget):
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: