From 0041e683fe3970d98207d77b03791edbffcc0123 Mon Sep 17 00:00:00 2001 From: Nyan404 Date: Tue, 25 Aug 2026 03:22:29 +0300 Subject: [PATCH] fix: enable VK image mirroring by default --- app/belki/image_host.py | 2 +- tests/test_image_host.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/belki/image_host.py b/app/belki/image_host.py index dc0d58f..035105c 100644 --- a/app/belki/image_host.py +++ b/app/belki/image_host.py @@ -28,7 +28,7 @@ class ImageHostClient: retention: Политика хранения (по умолчанию "forever") timeout: Таймаут HTTP-запросов в секундах """ - self.api_url = (api_url or os.getenv("BELKI_IMAGE_HOST_API_URL", "")).rstrip("/") + self.api_url = (api_url or os.getenv("BELKI_IMAGE_HOST_API_URL", "https://nyan.nyan404.ru")).rstrip("/") self.retention = retention self.timeout = timeout diff --git a/tests/test_image_host.py b/tests/test_image_host.py index faae29a..67c9ea8 100644 --- a/tests/test_image_host.py +++ b/tests/test_image_host.py @@ -5,6 +5,10 @@ from app.belki.image_host import ImageHostClient, ImageHostError class ImageHostClientTests(unittest.TestCase): + def test_default_client_targets_belki_image_host(self) -> None: + with patch.dict("os.environ", {}, clear=True): + self.assertEqual(ImageHostClient().api_url, "https://nyan.nyan404.ru") + def test_initiate_identifies_the_belki_client(self) -> None: client = ImageHostClient(api_url="https://api.example.test") response = MagicMock()