Tests wip

This commit is contained in:
Heitor Carvalho
2025-05-21 18:34:38 -03:00
parent 630655b7fb
commit 6ee9cc35d3
3 changed files with 7 additions and 7 deletions

View File

@@ -60,11 +60,11 @@ class TestTokenManager(unittest.TestCase):
mock_save.assert_called_once_with("secret.key", mock_key)
@patch("crewai.cli.authentication.utils.TokenManager.save_secure_file")
def test_save_tokens(self, mock_save):
def test_save_access_token(self, mock_save):
access_token = "test_token"
expires_in = 3600
self.token_manager.save_tokens(access_token, expires_in)
self.token_manager.save_access_token(access_token, expires_in)
mock_save.assert_called_once()
args = mock_save.call_args[0]

View File

@@ -13,7 +13,7 @@ from crewai.cli.cli import (
deply_status,
flow_add_crew,
reset_memories,
signup,
login,
test,
train,
version,
@@ -261,12 +261,12 @@ def test_test_invalid_string_iterations(evaluate_crew, runner):
@mock.patch("crewai.cli.cli.AuthenticationCommand")
def test_signup(command, runner):
def test_login(command, runner):
mock_auth = command.return_value
result = runner.invoke(signup)
result = runner.invoke(login)
assert result.exit_code == 0
mock_auth.signup.assert_called_once()
mock_auth.login.assert_called_once()
@mock.patch("crewai.cli.cli.DeployCommand")

View File

@@ -26,7 +26,7 @@ def in_temp_dir():
@pytest.fixture
def tool_command():
TokenManager().save_tokens("test-token", 36000)
TokenManager().save_access_token("test-token", 36000)
tool_command = ToolCommand()
with patch.object(tool_command, "login"):
yield tool_command