Merge testing for 2026.09.12
This commit is contained in:
@@ -59,6 +59,15 @@ pytest tests/ --cov=src/fenrirscreenreader --cov-report=html
|
|||||||
can run multiple foreground X terminal instances. Ask user to run tests that
|
can run multiple foreground X terminal instances. Ask user to run tests that
|
||||||
need real Fenrir instances or root access.
|
need real Fenrir instances or root access.
|
||||||
|
|
||||||
|
### Packaging Test Layouts
|
||||||
|
|
||||||
|
- Debian `pybuild` runs copied tests from a nested `.pybuild/.../build` tree
|
||||||
|
and may omit top-level source directories such as `config/`.
|
||||||
|
- Tests that inspect source resources must locate them by walking upward from
|
||||||
|
the resolved test path; do not assume a fixed `Path(__file__).parents[N]`.
|
||||||
|
- Packaging-sensitive test changes should be checked from both the source tree
|
||||||
|
and a representative nested build directory under `/tmp`.
|
||||||
|
|
||||||
## Creating Commands
|
## Creating Commands
|
||||||
|
|
||||||
Use `commands/command_template.py` as base. Required methods:
|
Use `commands/command_template.py` as base. Required methods:
|
||||||
|
|||||||
@@ -4,5 +4,5 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributors.
|
# By Chrys, Storm Dragon, and contributors.
|
||||||
|
|
||||||
version = "2026.09.09"
|
version = "2026.09.12"
|
||||||
code_name = "master"
|
code_name = "master"
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
from configparser import ConfigParser
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
def load_source_settings():
|
||||||
|
"""Load settings.conf from a checkout or a nested package build tree."""
|
||||||
|
for parent in Path(__file__).resolve().parents:
|
||||||
|
settings_path = parent / "config/settings/settings.conf"
|
||||||
|
if settings_path.is_file():
|
||||||
|
config = ConfigParser(interpolation=None)
|
||||||
|
config.read(settings_path)
|
||||||
|
return config
|
||||||
|
|
||||||
|
raise FileNotFoundError(
|
||||||
|
"Could not find config/settings/settings.conf above the test directory"
|
||||||
|
)
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
from configparser import ConfigParser
|
|
||||||
from pathlib import Path
|
|
||||||
from unittest.mock import Mock
|
from unittest.mock import Mock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
@@ -7,6 +5,8 @@ import pytest
|
|||||||
from fenrirscreenreader.core.settingsData import settings_data
|
from fenrirscreenreader.core.settingsData import settings_data
|
||||||
from fenrirscreenreader.soundDriver import genericDriver
|
from fenrirscreenreader.soundDriver import genericDriver
|
||||||
|
|
||||||
|
from .config_test_utils import load_source_settings
|
||||||
|
|
||||||
|
|
||||||
class SettingsManager:
|
class SettingsManager:
|
||||||
def __init__(self, settings):
|
def __init__(self, settings):
|
||||||
@@ -26,8 +26,7 @@ def _sound_driver(settings):
|
|||||||
|
|
||||||
|
|
||||||
def _configured_sound_settings():
|
def _configured_sound_settings():
|
||||||
config = ConfigParser(interpolation=None)
|
config = load_source_settings()
|
||||||
config.read(Path(__file__).parents[2] / "config/settings/settings.conf")
|
|
||||||
return {
|
return {
|
||||||
"generic_play_file_command": config.get(
|
"generic_play_file_command": config.get(
|
||||||
"sound", "generic_play_file_command"
|
"sound", "generic_play_file_command"
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
from configparser import ConfigParser
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from fenrirscreenreader.core.settingsData import settings_data
|
from fenrirscreenreader.core.settingsData import settings_data
|
||||||
from fenrirscreenreader.speechDriver import genericDriver
|
from fenrirscreenreader.speechDriver import genericDriver
|
||||||
|
|
||||||
|
from .config_test_utils import load_source_settings
|
||||||
|
|
||||||
|
|
||||||
def test_build_speech_command_replaces_snake_case_placeholders():
|
def test_build_speech_command_replaces_snake_case_placeholders():
|
||||||
speech_driver = genericDriver.driver()
|
speech_driver = genericDriver.driver()
|
||||||
@@ -43,8 +42,7 @@ def test_build_speech_command_replaces_snake_case_placeholders():
|
|||||||
|
|
||||||
|
|
||||||
def _configured_speech_command():
|
def _configured_speech_command():
|
||||||
config = ConfigParser(interpolation=None)
|
config = load_source_settings()
|
||||||
config.read(Path(__file__).parents[2] / "config/settings/settings.conf")
|
|
||||||
return config.get("speech", "generic_speech_command")
|
return config.get("speech", "generic_speech_command")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user