mirror of
https://github.com/smittix/intercept.git
synced 2026-07-07 09:08:12 -07:00
style: apply ruff-format to entire codebase
First-time run of ruff-format via pre-commit hook normalises quote style, trailing commas, and whitespace across 188 Python files. No logic changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
"""Tests for configuration module."""
|
||||
|
||||
|
||||
|
||||
class TestConfigEnvVars:
|
||||
"""Tests for environment variable configuration."""
|
||||
|
||||
@@ -10,39 +9,41 @@ class TestConfigEnvVars:
|
||||
from config import DEBUG, HOST, PORT
|
||||
|
||||
assert PORT == 5050
|
||||
assert HOST == '0.0.0.0'
|
||||
assert HOST == "0.0.0.0"
|
||||
assert DEBUG is False
|
||||
|
||||
def test_env_override(self, monkeypatch):
|
||||
"""Test that environment variables override defaults."""
|
||||
monkeypatch.setenv('INTERCEPT_PORT', '8080')
|
||||
monkeypatch.setenv('INTERCEPT_DEBUG', 'true')
|
||||
monkeypatch.setenv("INTERCEPT_PORT", "8080")
|
||||
monkeypatch.setenv("INTERCEPT_DEBUG", "true")
|
||||
|
||||
# Re-import to get new values
|
||||
import importlib
|
||||
|
||||
import config
|
||||
|
||||
importlib.reload(config)
|
||||
|
||||
assert config.PORT == 8080
|
||||
assert config.DEBUG is True
|
||||
|
||||
# Reset
|
||||
monkeypatch.delenv('INTERCEPT_PORT', raising=False)
|
||||
monkeypatch.delenv('INTERCEPT_DEBUG', raising=False)
|
||||
monkeypatch.delenv("INTERCEPT_PORT", raising=False)
|
||||
monkeypatch.delenv("INTERCEPT_DEBUG", raising=False)
|
||||
importlib.reload(config)
|
||||
|
||||
def test_invalid_env_values(self, monkeypatch):
|
||||
"""Test that invalid env values fall back to defaults."""
|
||||
monkeypatch.setenv('INTERCEPT_PORT', 'invalid')
|
||||
monkeypatch.setenv("INTERCEPT_PORT", "invalid")
|
||||
|
||||
import importlib
|
||||
|
||||
import config
|
||||
|
||||
importlib.reload(config)
|
||||
|
||||
# Should fall back to default
|
||||
assert config.PORT == 5050
|
||||
|
||||
monkeypatch.delenv('INTERCEPT_PORT', raising=False)
|
||||
monkeypatch.delenv("INTERCEPT_PORT", raising=False)
|
||||
importlib.reload(config)
|
||||
|
||||
Reference in New Issue
Block a user