mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 10:31:50 +01:00
feat: update check (#561)
feat(update-check): add robust update check with interval support, state management, and CLI integration - Implement version and interval-based update checks with configurable settings - Add CLI command `kleinanzeigen-bot update-check` for manual checks - Introduce state file with versioning, UTC timestamps, and migration logic - Validate and normalize intervals (1d–4w) with fallback for invalid values - Ensure correct handling of timezones and elapsed checks - Improve error handling, logging, and internationalization (i18n) - Add comprehensive test coverage for config, interval logic, migration, and CLI - Align default config, translations, and schema with new functionality - Improve help command UX by avoiding config/log loading for `--help` - Update documentation and README with full feature overview
This commit is contained in:
@@ -297,13 +297,11 @@ class TestKleinanzeigenBotConfiguration:
|
||||
test_bot.config_file_path = str(config_path)
|
||||
|
||||
with patch.object(LOG, "warning") as mock_warning:
|
||||
with pytest.raises(ValidationError) as exc_info:
|
||||
test_bot.load_config()
|
||||
|
||||
test_bot.load_config()
|
||||
mock_warning.assert_called_once()
|
||||
assert config_path.exists()
|
||||
assert "login.username" in str(exc_info.value)
|
||||
assert "login.password" in str(exc_info.value)
|
||||
assert test_bot.config.login.username == "changeme" # noqa: S105 placeholder for default config, not a real username
|
||||
assert test_bot.config.login.password == "changeme" # noqa: S105 placeholder for default config, not a real password
|
||||
|
||||
def test_load_config_validates_required_fields(self, test_bot:KleinanzeigenBot, test_data_dir:str) -> None:
|
||||
"""Verify that config validation checks required fields."""
|
||||
|
||||
Reference in New Issue
Block a user