Skip to content

Commit

Permalink
PEP8 fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
raquelalegre committed Apr 7, 2019
1 parent f3f97ee commit 0545cee
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions python/nammu/test/test_nammu.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from javax.swing import JSplitPane
from javax.swing.undo import CompoundEdit


@pytest.fixture
def simpletext():
return u'this is a simple test line'
Expand Down Expand Up @@ -122,7 +123,7 @@ def setup_class(self):
self.nammu = NammuController()

def teardown_class(self):
System.exit(0)
del self.nammu

@pytest.mark.parametrize('text', [simpletext(), english(), arabic(),
english_no_lem(), arabic_no_lem(),
Expand Down Expand Up @@ -272,9 +273,10 @@ def test_undo_empty_pane(self):
This test is needed because undoing empty panels is unstable and
sometimes raises exceptions.
'''
self.nammu.atfAreaController.clearAtfArea()
self.nammu.atfAreaController.undo()
assert ("edits: []" in self.nammu.atfAreaController.undo_manager.toString())
controller = self.nammu.atfAreaController
controller.clearAtfArea()
controller.undo()
assert ("edits: []" in controller.undo_manager.toString())

def test_redo_empty_pane(self):
'''
Expand All @@ -283,9 +285,10 @@ def test_redo_empty_pane(self):
This test is needed because undoing empty panels is unstable and
sometimes raises exceptions.
'''
self.nammu.atfAreaController.clearAtfArea()
self.nammu.atfAreaController.redo()
assert ("edits: []" in self.nammu.atfAreaController.undo_manager.toString())
controller = self.nammu.atfAreaController
controller.clearAtfArea()
controller.redo()
assert ("edits: []" in controller.undo_manager.toString())

def test_undo_after_opening_file(self, monkeypatch):
'''
Expand All @@ -297,12 +300,10 @@ def test_undo_after_opening_file(self, monkeypatch):
monkeypatch.setattr(javax.swing.JFileChooser, 'getSelectedFile',
selected_file_patch_english)
monkeypatch.setattr(self.nammu, 'handleUnsaved', unsaved_patch)

self.nammu.openFile()
self.nammu.closeFile()

self.nammu.atfAreaController.redo()
assert ("edits: []" in self.nammu.atfAreaController.undo_manager.toString())
controller = self.nammu.atfAreaController
controller.redo()
assert ("edits: []" in controller.undo_manager.toString())

def test_undo_after_closing_file(self, monkeypatch):
'''
Expand All @@ -314,12 +315,11 @@ def test_undo_after_closing_file(self, monkeypatch):
monkeypatch.setattr(javax.swing.JFileChooser, 'getSelectedFile',
selected_file_patch_english)
monkeypatch.setattr(self.nammu, 'handleUnsaved', unsaved_patch)

self.nammu.openFile()
self.nammu.closeFile()

self.nammu.atfAreaController.redo()
assert ("edits: []" in self.nammu.atfAreaController.undo_manager.toString())
controller = self.nammu.atfAreaController
controller.redo()
assert ("edits: []" in controller.undo_manager.toString())

def test_undo_edit_pane(self, empty_compound):
'''
Expand Down

0 comments on commit 0545cee

Please sign in to comment.