File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,3 +86,4 @@ __pycache__/
8686# Allow vscode
8787# !.vscode # Commented by default
8888CLAUDE.md
89+ CLAUDE.md
Original file line number Diff line number Diff line change 11# rust-genai Agent Instructions
22
33## Your Task
4- You are implementing issue #1 for the rust-genai Rust library.
4+ You are implementing issue #5 for the rust-genai Rust library.
55Focus ALL your effort on writing production-quality Rust code and tests.
66Do NOT run gitea-robot, tea, or any task-tracking commands.
77The orchestrator handles all task tracking.
Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ impl AuthData {
6363 Ok ( value)
6464 }
6565 AuthData :: Key ( value) => Ok ( value. to_string ( ) ) ,
66+ // No-auth providers return an empty string
67+ AuthData :: None => Ok ( String :: new ( ) ) ,
6668 _ => Err ( Error :: ResolverAuthDataNotSingleValue ) ,
6769 }
6870 }
@@ -126,6 +128,25 @@ mod tests {
126128 let value = auth. single_key_value ( ) . unwrap ( ) ;
127129 assert_eq ! ( value, "" ) ;
128130 }
131+ #[ test]
132+ fn test_none_single_key_value_returns_empty ( ) {
133+ let auth = AuthData :: None ;
134+ let value = auth. single_key_value ( ) . unwrap ( ) ;
135+ assert_eq ! ( value, "" ) ;
136+ }
137+
138+ #[ test]
139+ fn test_none_debug ( ) {
140+ let auth = AuthData :: None ;
141+ let debug = format ! ( "{:?}" , auth) ;
142+ assert_eq ! ( debug, "None" ) ;
143+ }
144+
145+ #[ test]
146+ fn test_multi_keys_single_key_value_errors ( ) {
147+ let auth = AuthData :: from_multi ( HashMap :: new ( ) ) ;
148+ assert ! ( auth. single_key_value( ) . is_err( ) ) ;
149+ }
129150}
130151
131152// endregion: --- Tests
You can’t perform that action at this time.
0 commit comments