editor test cleanup

This commit is contained in:
Florian Bruhin 2014-05-27 11:17:14 +02:00
parent 156d63b4b6
commit 15f8a3e6dd

View File

@ -45,9 +45,6 @@ class ConfigStub:
class FakeQProcess:
finished = Mock()
error = Mock()
NormalExit = QProcess.NormalExit
CrashExit = QProcess.CrashExit
@ -58,17 +55,10 @@ class FakeQProcess:
ReadError = QProcess.ReadError
UnknownError = QProcess.UnknownError
def __init__(self, parent):
self.executable = None
self.args = None
def start(self, executable, args):
self.executable = executable
self.args = args
self.on_started()
def on_started(self):
pass
def __init__(self, parent=None):
self.finished = Mock()
self.error = Mock()
self.start = Mock()
def setUpModule():
@ -84,7 +74,7 @@ class FileHandlingTests(TestCase):
def setUp(self):
self.editor = editor.ExternalEditor()
self.editor.editing_finished = Mock()
editor.config = ConfigStub([""])
editor.config = ConfigStub(editor=[""])
def test_file_handling_closed_ok(self):
"""Test file handling when closing with an exitstatus == 0."""
@ -112,9 +102,5 @@ class FileHandlingTests(TestCase):
self.assertFalse(os.path.exists(filename))
#self.editor.proc.start.assert_called_with("")
#self.assertTrue(self.editor.proc.
if __name__ == '__main__':
unittest.main()