-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔀 Merge pull request #34 from MathisFederico/refactor/tests/integration
🔧 📝 Refactor integration tests
- Loading branch information
Showing
5 changed files
with
129 additions
and
124 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,17 @@ | ||
# OpenCodeBlock an open-source tool for modular visual programing in python | ||
# Copyright (C) 2021 Mathïs FEDERICO <https://www.gnu.org/licenses/> | ||
|
||
""" Integration tests for the opencodeblocks package. """ | ||
""" | ||
Integration tests for the OCB package. | ||
We use xvfb to perform the tests without opening any windows. | ||
We use pyautogui to move the mouse and interact with the application. | ||
To pass the tests on windows, you need to not move the mouse. | ||
Use this if you need to understand why a test fails. | ||
To pass the tests on linux, you just need to install xvfb and it's dependencies. | ||
On linux, no windows are opened to the user during the test. | ||
To understand why a test fails, pass the flag "--no-xvfb" and use your own X server | ||
to see the test running live. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# OpenCodeBlock an open-source tool for modular visual programing in python | ||
# Copyright (C) 2021 Mathïs FEDERICO <https://www.gnu.org/licenses/> | ||
|
||
""" | ||
Integration tests for the OCBWindow. | ||
""" | ||
|
||
import os | ||
import pytest | ||
|
||
from pytest_mock import MockerFixture | ||
from opencodeblocks.graphics.window import OCBWindow | ||
|
||
class TestWindow: | ||
|
||
@pytest.fixture(autouse=True) | ||
def setup(self, mocker:MockerFixture): | ||
""" Setup reused variables. """ | ||
self.window = OCBWindow() | ||
|
||
def test_window_close(self, qtbot): | ||
""" closes """ | ||
self.window.close() | ||
|
||
def test_open_file(self): | ||
""" loads files """ | ||
wnd = OCBWindow() | ||
file_example_path = "./tests/assets/example_graph1.ipyg" | ||
subwnd = wnd.createNewMdiChild(os.path.abspath(file_example_path)) | ||
subwnd.show() | ||
wnd.close() |