Skip to content

Commit 37e2563

Browse files
committed
test: hoist _humanize_alert_type import to module scope
1 parent 756a8be commit 37e2563

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

tests/core/test_package_and_alerts.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest
55
from socketdev import socketdev
66

7-
from socketsecurity.core import Core
7+
from socketsecurity.core import Core, _humanize_alert_type
88
from socketsecurity.core.classes import Issue, Package
99
from socketsecurity.core.socket_config import SocketConfig
1010

@@ -326,23 +326,18 @@ def test_get_license_text_via_purl_uses_org_scoped_endpoint(self, core, mock_sdk
326326

327327
class TestHumanizeAlertType:
328328
def test_humanizes_camel_case(self):
329-
from socketsecurity.core import _humanize_alert_type
330329
assert _humanize_alert_type("gptDidYouMean") == "Gpt Did You Mean"
331330

332331
def test_humanizes_single_word(self):
333-
from socketsecurity.core import _humanize_alert_type
334332
assert _humanize_alert_type("malware") == "Malware"
335333

336334
def test_humanizes_pascal_case(self):
337-
from socketsecurity.core import _humanize_alert_type
338335
assert _humanize_alert_type("UnsafeShellAccess") == "Unsafe Shell Access"
339336

340337
def test_empty_input_returns_empty_string(self):
341-
from socketsecurity.core import _humanize_alert_type
342338
assert _humanize_alert_type("") == ""
343339

344340
def test_handles_acronyms_conservatively(self):
345341
"""Adjacent capitals are kept together: SQLInjection -> 'SQL Injection'."""
346-
from socketsecurity.core import _humanize_alert_type
347342
assert _humanize_alert_type("SQLInjection") == "SQL Injection"
348343

0 commit comments

Comments
 (0)