Исправлены ошибки, выявленные на тесте инфраструктуры
This commit is contained in:
@@ -9,7 +9,14 @@ from contextlib import redirect_stdout
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
from infratest import ConfigError, Reporter, Settings, as_bool, sanitize
|
||||
from infratest import (
|
||||
ConfigError,
|
||||
Reporter,
|
||||
Settings,
|
||||
as_bool,
|
||||
sanitize,
|
||||
virtual_hosted_bucket_url,
|
||||
)
|
||||
|
||||
|
||||
def valid_env(ca_path: Path) -> str:
|
||||
@@ -102,6 +109,19 @@ class SettingsTests(unittest.TestCase):
|
||||
Settings.from_env_file(env_file)
|
||||
|
||||
|
||||
class UrlTests(unittest.TestCase):
|
||||
def test_virtual_hosted_bucket_url(self) -> None:
|
||||
url = virtual_hosted_bucket_url(
|
||||
"https://s3.storage.selcloud.ru",
|
||||
"han-chat-quarantine",
|
||||
"infratest/key.bin",
|
||||
)
|
||||
self.assertEqual(
|
||||
url,
|
||||
"https://han-chat-quarantine.s3.storage.selcloud.ru/infratest/key.bin",
|
||||
)
|
||||
|
||||
|
||||
class SafetyTests(unittest.TestCase):
|
||||
def test_sanitize_redacts_secret_and_url_query(self) -> None:
|
||||
value = (
|
||||
|
||||
Reference in New Issue
Block a user