MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / test_load_api_keys

Function test_load_api_keys

tests/api_utils/test_auth_utils.py:12–21  ·  view source on GitHub ↗

Test loading API keys from file.

()

Source from the content-addressed store, hash-verified

10
11
12def test_load_api_keys():
13 """Test loading API keys from file."""
14 mock_content = "key1\nkey2\n\nkey3"
15 with patch("builtins.open", mock_open(read_data=mock_content)):
16 with patch("os.path.exists", return_value=True):
17 load_api_keys()
18 assert "key1" in API_KEYS
19 assert "key2" in API_KEYS
20 assert "key3" in API_KEYS
21 assert len(API_KEYS) == 3
22
23
24def test_initialize_keys_creates_file():

Callers

nothing calls this directly

Calls 1

load_api_keysFunction · 0.90

Tested by

no test coverage detected