From d437e756e9a0bd8b5f9f4471b5c5076b33b7f067 Mon Sep 17 00:00:00 2001 From: Nick Tindle Date: Thu, 12 Feb 2026 17:13:38 -0600 Subject: [PATCH] fix(classic): fix bulletin test - mock web to return content when testing is_new --- classic/original_autogpt/tests/unit/test_utils.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/classic/original_autogpt/tests/unit/test_utils.py b/classic/original_autogpt/tests/unit/test_utils.py index d3bf3d0b1f..bc957ab9b8 100644 --- a/classic/original_autogpt/tests/unit/test_utils.py +++ b/classic/original_autogpt/tests/unit/test_utils.py @@ -82,13 +82,18 @@ def test_get_bulletin_from_web_exception(mock_get): def test_get_latest_bulletin_no_file(tmp_path, monkeypatch): - bulletin_path = tmp_path / "data" / "CURRENT_BULLETIN.md" + data_dir = tmp_path / "data" + data_dir.mkdir(parents=True, exist_ok=True) + bulletin_path = data_dir / "CURRENT_BULLETIN.md" monkeypatch.chdir(tmp_path) # Ensure file doesn't exist if bulletin_path.exists(): bulletin_path.unlink() - with patch("autogpt.app.utils.get_bulletin_from_web", return_value=""): + # When no local file exists and web returns new content, is_new should be True + with patch( + "autogpt.app.utils.get_bulletin_from_web", return_value="New bulletin content" + ): bulletin, is_new = get_latest_bulletin() assert is_new