Skip to content

Commit 9724481

Browse files
author
Lukas Geiger
committed
Align platform smoke tests and install image test dependency
Signed-off-by: Lukas Geiger <lukas@um-bruch.org>
1 parent d528a85 commit 9724481

3 files changed

Lines changed: 23 additions & 7 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
- name: Install Project Dependencies
8181
run: |
8282
python -m pip install --upgrade pip
83-
python -m pip install -r requirements.txt pytest
83+
python -m pip install -r requirements.txt pytest Pillow
8484
8585
- name: Run Pytest Test Suite
8686
run: pytest -v

‎tests/linux_platform_smoke.py‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def __init__(self, parent=None) -> None:
6767
self.readyReadStandardOutput = _DummySignal()
6868
self.readyReadStandardError = _DummySignal()
6969
self.finished = _DummySignal()
70+
self.errorOccurred = _DummySignal()
7071

7172
def setWorkingDirectory(self, cwd: str) -> None:
7273
self.cwd = cwd
@@ -93,7 +94,7 @@ def _exercise_window_open_and_run() -> None:
9394
print("Test 1: Offscreen-Hauptfenster öffnet Datei und löst Run-Command aus")
9495
app = _ensure_app()
9596
with tempfile.TemporaryDirectory(prefix="codebox-linux-window-") as tmpdir_str:
96-
tmpdir = Path(tmpdir_str)
97+
tmpdir = Path(tmpdir_str).resolve()
9798
project_dir = tmpdir / "Projekt Übersicht"
9899
project_dir.mkdir(parents=True)
99100
script_path = project_dir / "überblick.py"
@@ -119,10 +120,17 @@ def _exercise_window_open_and_run() -> None:
119120
_assert(window.output.run_btn.isEnabled(), "Run-Button blieb deaktiviert.")
120121

121122
captured: list[list[str]] = []
122-
window.output.run_command = lambda command: captured.append(command)
123+
captured_debug_modes: list[bool] = []
124+
125+
def capture_command(command, is_debug=False):
126+
captured.append(command)
127+
captured_debug_modes.append(is_debug)
128+
129+
window.output.run_command = capture_command
123130
window.run_current()
124131

125-
_assert(captured == [["python", "-u", str(script_path)]], repr(captured))
132+
_assert(captured == [[sys.executable or "python", "-u", str(script_path)]], repr(captured))
133+
_assert(captured_debug_modes == [False], repr(captured_debug_modes))
126134
finally:
127135
window.close()
128136
app.processEvents()

‎tests/macos_platform_smoke.py‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def __init__(self, parent=None) -> None:
6767
self.readyReadStandardOutput = _DummySignal()
6868
self.readyReadStandardError = _DummySignal()
6969
self.finished = _DummySignal()
70+
self.errorOccurred = _DummySignal()
7071

7172
def setWorkingDirectory(self, cwd: str) -> None:
7273
self.cwd = cwd
@@ -93,7 +94,7 @@ def _exercise_window_open_and_run() -> None:
9394
print("Test 1: Offscreen-Hauptfenster öffnet Datei und löst Run-Command aus")
9495
app = _ensure_app()
9596
with tempfile.TemporaryDirectory(prefix="codebox-macos-window-") as tmpdir_str:
96-
tmpdir = Path(tmpdir_str)
97+
tmpdir = Path(tmpdir_str).resolve()
9798
project_dir = tmpdir / "Projekt Übersicht"
9899
project_dir.mkdir(parents=True)
99100
script_path = project_dir / "überblick.py"
@@ -122,10 +123,17 @@ def _exercise_window_open_and_run() -> None:
122123
_assert(window.output.run_btn.isEnabled(), "Run-Button blieb deaktiviert.")
123124

124125
captured: list[list[str]] = []
125-
window.output.run_command = lambda command: captured.append(command)
126+
captured_debug_modes: list[bool] = []
127+
128+
def capture_command(command, is_debug=False):
129+
captured.append(command)
130+
captured_debug_modes.append(is_debug)
131+
132+
window.output.run_command = capture_command
126133
window.run_current()
127134

128-
_assert(captured == [["python", "-u", str(script_path)]], repr(captured))
135+
_assert(captured == [[sys.executable or "python", "-u", str(script_path)]], repr(captured))
136+
_assert(captured_debug_modes == [False], repr(captured_debug_modes))
129137
finally:
130138
window.close()
131139
app.processEvents()

0 commit comments

Comments
 (0)