Skip to content

Commit ecddc2c

Browse files
Potential fix for code scanning alert no. 20: Incomplete URL substring sanitization
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 6d60196 commit ecddc2c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/python/pocketoption/test_sync_mocked.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import types
55
from datetime import timedelta
66
from unittest.mock import AsyncMock, MagicMock
7+
from urllib.parse import urlparse
78

89
import pytest
910

@@ -529,7 +530,10 @@ def test_init_with_invalid_config_type(self):
529530
def test_init_with_custom_url(self, mock_pocketoption_async):
530531
"""Test that custom URL is added to config."""
531532
client = PocketOption("test_ssid", url="wss://custom.com")
532-
assert "wss://custom.com" in client.config.urls
533+
assert any(
534+
(parsed.scheme, parsed.hostname) == ("wss", "custom.com")
535+
for parsed in (urlparse(url) for url in client.config.urls)
536+
)
533537
client.shutdown()
534538

535539

0 commit comments

Comments
 (0)