MCPcopy Create free account
hub / github.com/Louisym/MiniCC / read_api_key_requires_non_empty_value

Function read_api_key_requires_non_empty_value

rust/crates/api/src/client.rs:680–687  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

678
679 #[test]
680 fn read_api_key_requires_non_empty_value() {
681 let _guard = env_lock();
682 std::env::set_var("ANTHROPIC_AUTH_TOKEN", "");
683 std::env::remove_var("ANTHROPIC_API_KEY");
684 let error = super::read_api_key().expect_err("empty key should error");
685 assert!(matches!(error, crate::error::ApiError::MissingApiKey));
686 std::env::remove_var("ANTHROPIC_AUTH_TOKEN");
687 }
688
689 #[test]
690 fn read_api_key_prefers_api_key_env() {

Callers

nothing calls this directly

Calls 2

read_api_keyFunction · 0.85
env_lockFunction · 0.70

Tested by

no test coverage detected