@@ -3170,3 +3170,43 @@ async fn test_llm_obs_spans_search_no_auth() {
31703170 assert ! ( result. is_err( ) , "should fail without auth" ) ;
31713171 cleanup_env ( ) ;
31723172}
3173+
3174+ // -------------------------------------------------------------------------
3175+ // Auth status --site flag
3176+ // -------------------------------------------------------------------------
3177+
3178+ #[ test]
3179+ fn test_auth_status_accepts_site_flag ( ) {
3180+ use clap:: Parser ;
3181+
3182+ let cli = crate :: Cli :: try_parse_from ( [ "pup" , "auth" , "status" , "--site" , "datadoghq.eu" ] )
3183+ . expect ( "auth status --site should parse" ) ;
3184+
3185+ match cli. command {
3186+ crate :: Commands :: Auth { action } => match action {
3187+ crate :: AuthActions :: Status { site } => {
3188+ assert_eq ! ( site, Some ( "datadoghq.eu" . to_string( ) ) ) ;
3189+ }
3190+ _ => panic ! ( "expected AuthActions::Status" ) ,
3191+ } ,
3192+ _ => panic ! ( "expected Commands::Auth" ) ,
3193+ }
3194+ }
3195+
3196+ #[ test]
3197+ fn test_auth_status_site_flag_is_optional ( ) {
3198+ use clap:: Parser ;
3199+
3200+ let cli = crate :: Cli :: try_parse_from ( [ "pup" , "auth" , "status" ] )
3201+ . expect ( "auth status without --site should parse" ) ;
3202+
3203+ match cli. command {
3204+ crate :: Commands :: Auth { action } => match action {
3205+ crate :: AuthActions :: Status { site } => {
3206+ assert_eq ! ( site, None ) ;
3207+ }
3208+ _ => panic ! ( "expected AuthActions::Status" ) ,
3209+ } ,
3210+ _ => panic ! ( "expected Commands::Auth" ) ,
3211+ }
3212+ }
0 commit comments