From 15f8a3e6dd81f5261a5b12ac1d087d399ec59185 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 27 May 2014 11:17:14 +0200 Subject: [PATCH] editor test cleanup --- qutebrowser/test/utils/test_editor.py | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/qutebrowser/test/utils/test_editor.py b/qutebrowser/test/utils/test_editor.py index 78ea9bdea..e510f1ae9 100644 --- a/qutebrowser/test/utils/test_editor.py +++ b/qutebrowser/test/utils/test_editor.py @@ -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()