MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / test_config_override_env

Function test_config_override_env

tests/unit/test_config.py:54–78  ·  view source on GitHub ↗

Test that kwargs override environment variables

(mock_env, valid_uuid)

Source from the content-addressed store, hash-verified

52
53
54def test_config_override_env(mock_env, valid_uuid):
55 """Test that kwargs override environment variables"""
56 config = Config()
57
58 # Store the original value from environment
59 original_max_queue_size = config.max_queue_size
60
61 config.configure(
62 api_key=valid_uuid,
63 endpoint="https://override.agentops.ai",
64 app_url="https://override-app.agentops.ai",
65 max_wait_time=2000,
66 default_tags=["new-tag"],
67 instrument_llm_calls=True,
68 max_queue_size=original_max_queue_size, # Explicitly pass the original value
69 )
70
71 assert config.api_key == valid_uuid
72 assert config.endpoint == "https://override.agentops.ai"
73 assert config.app_url == "https://override-app.agentops.ai"
74 assert config.max_wait_time == 2000
75 assert config.default_tags == {"new-tag"}
76 assert config.instrument_llm_calls is True
77 # Other values should remain from env
78 assert config.max_queue_size == 256 # Use the value from mock_env
79
80
81def test_invalid_api_key():

Callers

nothing calls this directly

Calls 2

configureMethod · 0.95
ConfigClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…