Add brand-specific update channel and environment configuration
- Updated `brand_config.py` to include `WEBDROP_UPDATE_CHANNEL` in the environment variables. - Enhanced `build_macos.sh` to create a bundled `.env` file with brand-specific defaults, including the update channel. - Implemented a method in `build_windows.py` to create a bundled `.env` file for Windows builds, incorporating brand-specific runtime defaults. - Modified `config.py` to ensure the application can locate the `.env` file in various installation scenarios. - Added unit tests in `test_config.py` to verify the loading of the bootstrap `.env` from the PyInstaller runtime directory. - Generated new WiX object and script files for the Windows installer, including application shortcuts and registry entries.
This commit is contained in:
parent
de6e9838e5
commit
eab1009d8c
9 changed files with 3083 additions and 2886 deletions
|
|
@ -1,6 +1,7 @@
|
|||
"""Unit tests for configuration system."""
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
|
|
@ -232,3 +233,22 @@ class TestConfigValidation:
|
|||
|
||||
assert config_path.parts[-2:] == ("agravity_bridge", "config.json")
|
||||
assert log_path.parts[-2:] == ("logs", "agravity_bridge.log")
|
||||
|
||||
|
||||
class TestBootstrapEnvLoading:
|
||||
"""Test bootstrap .env loading behavior for packaged builds."""
|
||||
|
||||
def test_load_bootstrap_env_reads_meipass_dotenv(self, tmp_path, monkeypatch):
|
||||
"""Packaged app should load .env from PyInstaller runtime directory."""
|
||||
meipass_dir = tmp_path / "runtime"
|
||||
meipass_dir.mkdir(parents=True)
|
||||
env_path = meipass_dir / ".env"
|
||||
env_path.write_text("APP_NAME=Agravity Bridge\n", encoding="utf-8")
|
||||
|
||||
monkeypatch.setattr(sys, "frozen", True, raising=False)
|
||||
monkeypatch.setattr(sys, "_MEIPASS", str(meipass_dir), raising=False)
|
||||
|
||||
loaded_path = Config.load_bootstrap_env()
|
||||
|
||||
assert loaded_path == env_path
|
||||
assert os.getenv("APP_NAME") == "Agravity Bridge"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue