Skip to content

Commit

Permalink
🔧 Put pyeditor in its submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
FabienRoger committed Dec 23, 2021
1 parent 64ecee7 commit c783c1b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions opencodeblocks/graphics/pyeditor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
""" Module for the Python Editor. """

from opencodeblocks.graphics.pyeditor.pyeditor import PythonEditor, POINT_SIZE
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
QWheelEvent,
)
from PyQt5.Qsci import QsciScintilla, QsciLexerPython
from opencodeblocks.graphics.editor_history import EditorHistory
from opencodeblocks.graphics.pyeditor.history import EditorHistory
from opencodeblocks.graphics.theme_manager import theme_manager

from opencodeblocks.blocks.block import OCBBlock
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion opencodeblocks/scene/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from opencodeblocks.blocks.block import OCBBlock
from opencodeblocks.graphics.edge import OCBEdge
from opencodeblocks.scene.clipboard import SceneClipboard
from opencodeblocks.scene.scene_history import SceneHistory
from opencodeblocks.scene.history import SceneHistory
from opencodeblocks.scene.from_ipynb_conversion import ipynb_to_ipyg
from opencodeblocks.scene.to_ipynb_conversion import ipyg_to_ipynb

Expand Down
14 changes: 7 additions & 7 deletions tests/unit/scene/test_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pytest_mock import MockerFixture
import pytest_check as check

from opencodeblocks.scene.scene_history import SceneHistory
from opencodeblocks.scene.history import SceneHistory


class TestUndo:
Expand All @@ -23,7 +23,7 @@ def setup(self, mocker: MockerFixture):

def test_undo(self, mocker: MockerFixture):
"""should allow for undo without breaking the history stack."""
mocker.patch("opencodeblocks.scene.scene_history.SceneHistory.restore")
mocker.patch("opencodeblocks.scene.history.SceneHistory.restore")

check.equal(self.history.history_stack, ["A", "B", "C", "D"])
check.equal(self.history.history_stack[self.history.current], "D")
Expand All @@ -36,7 +36,7 @@ def test_undo(self, mocker: MockerFixture):

def test_undo_nostack(self, mocker: MockerFixture):
"""should allow to undo without any change if the history stack is empty."""
mocker.patch("opencodeblocks.scene.scene_history.SceneHistory.restore")
mocker.patch("opencodeblocks.scene.history.SceneHistory.restore")

self.history.history_stack = []
self.history.current = -1
Expand All @@ -49,7 +49,7 @@ def test_undo_nostack(self, mocker: MockerFixture):

def test_undo_end_of_stack(self, mocker: MockerFixture):
"""should allow to undo without any change if at the end of the history stack."""
mocker.patch("opencodeblocks.scene.scene_history.SceneHistory.restore")
mocker.patch("opencodeblocks.scene.history.SceneHistory.restore")

self.history.current = 0
check.equal(self.history.history_stack, ["A", "B", "C", "D"])
Expand All @@ -75,7 +75,7 @@ def setup(self, mocker: MockerFixture):

def test_redo(self, mocker: MockerFixture):
"""should allow for redo without changing the history stack."""
mocker.patch("opencodeblocks.scene.scene_history.SceneHistory.restore")
mocker.patch("opencodeblocks.scene.history.SceneHistory.restore")

check.equal(self.history.history_stack, ["A", "B", "C", "D"])
check.equal(self.history.history_stack[self.history.current], "B")
Expand All @@ -88,7 +88,7 @@ def test_redo(self, mocker: MockerFixture):

def test_redo_nostack(self, mocker: MockerFixture):
"""should allow to redo without any change if the history stack is empty."""
mocker.patch("opencodeblocks.scene.scene_history.SceneHistory.restore")
mocker.patch("opencodeblocks.scene.history.SceneHistory.restore")

self.history.history_stack = []
self.history.current = -1
Expand All @@ -101,7 +101,7 @@ def test_redo_nostack(self, mocker: MockerFixture):

def test_redo_end_of_stack(self, mocker: MockerFixture):
"""should allow to redo without any change if at the beggining of the history stack."""
mocker.patch("opencodeblocks.scene.scene_history.SceneHistory.restore")
mocker.patch("opencodeblocks.scene.history.SceneHistory.restore")

self.history.current = 3
check.equal(self.history.history_stack, ["A", "B", "C", "D"])
Expand Down

0 comments on commit c783c1b

Please sign in to comment.