refactor: uv-based deps, no nexus auth, LLM retries, lock cleanup, health checks, e2e tests
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
"""Tests for GuardDog scanner integration."""
|
||||
|
||||
import asyncio
|
||||
from unittest.mock import MagicMock, patch
|
||||
import warnings
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -61,10 +62,16 @@ def test_normalize_semgrep_list():
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_scan_package_timeout():
|
||||
with patch("asyncio.wait_for", side_effect=asyncio.TimeoutError):
|
||||
result = await scan_package("/tmp/test.tar.gz", "pypi")
|
||||
assert result["findings"] == []
|
||||
assert "timeout" in result["errors"][0]
|
||||
mock_proc = MagicMock()
|
||||
mock_proc.communicate = AsyncMock(return_value=(b"", b""))
|
||||
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore", RuntimeWarning)
|
||||
with patch("asyncio.create_subprocess_exec", return_value=mock_proc):
|
||||
with patch("asyncio.wait_for", side_effect=asyncio.TimeoutError):
|
||||
result = await scan_package("/tmp/test.tar.gz", "pypi")
|
||||
assert result["findings"] == []
|
||||
assert "timeout" in result["errors"][0]
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user