mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-28 09:38:17 +00:00
fix
This commit is contained in:
@@ -19,6 +19,7 @@ class TestPlatformIntegrationToken:
|
|||||||
def teardown_method(self):
|
def teardown_method(self):
|
||||||
_platform_integration_token.set(None)
|
_platform_integration_token.set(None)
|
||||||
|
|
||||||
|
@patch.dict(os.environ, {}, clear=True)
|
||||||
def test_set_platform_integration_token(self):
|
def test_set_platform_integration_token(self):
|
||||||
test_token = "test-token-123"
|
test_token = "test-token-123"
|
||||||
|
|
||||||
@@ -55,6 +56,7 @@ class TestPlatformIntegrationToken:
|
|||||||
|
|
||||||
assert get_platform_integration_token() is None
|
assert get_platform_integration_token() is None
|
||||||
|
|
||||||
|
@patch.dict(os.environ, {}, clear=True)
|
||||||
def test_platform_context_manager_basic_usage(self):
|
def test_platform_context_manager_basic_usage(self):
|
||||||
test_token = "context-manager-token"
|
test_token = "context-manager-token"
|
||||||
|
|
||||||
@@ -65,6 +67,7 @@ class TestPlatformIntegrationToken:
|
|||||||
|
|
||||||
assert get_platform_integration_token() is None
|
assert get_platform_integration_token() is None
|
||||||
|
|
||||||
|
@patch.dict(os.environ, {}, clear=True)
|
||||||
def test_platform_context_manager_nested_contexts(self):
|
def test_platform_context_manager_nested_contexts(self):
|
||||||
"""Test nested platform_context context managers."""
|
"""Test nested platform_context context managers."""
|
||||||
outer_token = "outer-token"
|
outer_token = "outer-token"
|
||||||
@@ -109,6 +112,7 @@ class TestPlatformIntegrationToken:
|
|||||||
|
|
||||||
assert get_platform_integration_token() == initial_token
|
assert get_platform_integration_token() == initial_token
|
||||||
|
|
||||||
|
@patch.dict(os.environ, {}, clear=True)
|
||||||
def test_platform_context_manager_with_none_initial_state(self):
|
def test_platform_context_manager_with_none_initial_state(self):
|
||||||
"""Test platform_context when initial state is None."""
|
"""Test platform_context when initial state is None."""
|
||||||
context_token = "context-token"
|
context_token = "context-token"
|
||||||
@@ -134,6 +138,7 @@ class TestPlatformIntegrationToken:
|
|||||||
|
|
||||||
assert get_platform_integration_token() == "env-backup"
|
assert get_platform_integration_token() == "env-backup"
|
||||||
|
|
||||||
|
@patch.dict(os.environ, {}, clear=True)
|
||||||
def test_multiple_sequential_context_managers(self):
|
def test_multiple_sequential_context_managers(self):
|
||||||
"""Test multiple sequential uses of platform_context."""
|
"""Test multiple sequential uses of platform_context."""
|
||||||
token1 = "token-1"
|
token1 = "token-1"
|
||||||
@@ -194,6 +199,7 @@ class TestPlatformIntegrationToken:
|
|||||||
with pytest.raises(OSError):
|
with pytest.raises(OSError):
|
||||||
get_platform_integration_token()
|
get_platform_integration_token()
|
||||||
|
|
||||||
|
@patch.dict(os.environ, {}, clear=True)
|
||||||
def test_context_var_isolation_between_tests(self):
|
def test_context_var_isolation_between_tests(self):
|
||||||
"""Test that context variable changes don't leak between test methods."""
|
"""Test that context variable changes don't leak between test methods."""
|
||||||
test_token = "isolation-test-token"
|
test_token = "isolation-test-token"
|
||||||
|
|||||||
Reference in New Issue
Block a user