Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix: Fix get_current_git_branch test

Reinier van der Leerba8f83d09d22
diff --git a/autogpts/autogpt/tests/unit/test_utils.py b/autogpts/autogpt/tests/unit/test_utils.py
index 8afbc45918..afe2497dca 100644
--- a/autogpts/autogpt/tests/unit/test_utils.py
+++ b/autogpts/autogpt/tests/unit/test_utils.py
@@ -3,6 +3,7 @@ from unittest.mock import patch
import pytest
import requests
+from git import InvalidGitRepositoryError
from autogpt.app.utils import (
get_bulletin_from_web,
@@ -186,7 +187,7 @@ def test_get_current_git_branch_success(mock_repo):
@patch("autogpt.app.utils.Repo")
def test_get_current_git_branch_failure(mock_repo):
- mock_repo.side_effect = Exception()
+ mock_repo.side_effect = InvalidGitRepositoryError()
branch_name = get_current_git_branch()
assert branch_name == ""