Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions tests/test_submit_cves_and_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

from unittest.mock import MagicMock, patch

import pytest

# ---------------------------------------------------------------------------
# Helpers
# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -207,8 +205,9 @@ def test_result_has_tool_use_id(self, monkeypatch):


class TestSubmitCvesMissingUrl:
def test_no_url_raises_value_error(self, monkeypatch):
"""When neither config nor env has a webhook URL, submit_cves raises ValueError."""
def test_no_url_returns_error_status(self, monkeypatch):
"""When neither config nor env has a webhook URL, submit_cves returns an
error-status dict instead of raising ValueError to the caller."""
monkeypatch.delenv("CVE_SUBMIT_URL", raising=False)
with patch("manus_agent.tools.submit_cves.Config") as mock_config:
cfg = MagicMock()
Expand All @@ -217,11 +216,11 @@ def test_no_url_raises_value_error(self, monkeypatch):

from manus_agent.tools.submit_cves import submit_cves

with pytest.raises(ValueError, match="webhook URL"):
submit_cves(_make_tool_use())
result = submit_cves(_make_tool_use())
assert result["status"] == "error"

def test_no_url_error_message_mentions_config_toml(self, monkeypatch):
"""ValueError message should guide users to config.toml."""
"""Error message should guide users to config.toml."""
monkeypatch.delenv("CVE_SUBMIT_URL", raising=False)
with patch("manus_agent.tools.submit_cves.Config") as mock_config:
cfg = MagicMock()
Expand All @@ -230,8 +229,9 @@ def test_no_url_error_message_mentions_config_toml(self, monkeypatch):

from manus_agent.tools.submit_cves import submit_cves

with pytest.raises(ValueError, match="config.toml"):
submit_cves(_make_tool_use())
result = submit_cves(_make_tool_use())
assert result["status"] == "error"
assert "config.toml" in result["content"][0]["text"]


# ===========================================================================
Expand Down
Loading