The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
chore(cli): add tests for main entry point
Steven Enamakel76f993ed8993
diff --git a/crates/openhuman-cli/src/main_tests.rs b/crates/openhuman-cli/src/main_tests.rsindex 31a564137c..904901d356 100644--- a/crates/openhuman-cli/src/main_tests.rs+++ b/crates/openhuman-cli/src/main_tests.rs@@ -1,55 +1,37 @@use super::*;#[test]-fn scrubs_bearer_token() {- assert_eq!(- scrub_secrets("Authorization: Bearer abc123xyz"),- "Authorization: Bearer [REDACTED]"- );+fn environment_prefers_app_env_lowercased() {+ assert_eq!(resolve_environment(Some(" Staging ".into())), "staging");}#[test]-fn scrubs_api_key() {- assert_eq!(scrub_secrets("api_key=sk-abc123"), "api_key=[REDACTED]");+fn environment_falls_back_on_blank_or_missing() {+ let expected = if cfg!(debug_assertions) {+ "development"+ } else {+ "production"+ };+ assert_eq!(resolve_environment(None), expected);+ assert_eq!(resolve_environment(Some(" ".into())), expected);}#[test]-fn scrubs_anthropic_key() {- assert_eq!(- scrub_secrets("key: sk-ant-api03-abcdefghijklmnop"),- "key: [REDACTED]"- );+fn release_tag_uses_the_crate_version() {+ let tag = process::sentry::release_tag(env!("CARGO_PKG_VERSION"), None);+ assert_eq!(tag, format!("openhuman@{}", env!("CARGO_PKG_VERSION")));}#[test]-fn scrubs_openai_admin_key() {+fn the_shared_chain_scrubs_secrets() {+ // The CLI no longer carries its own scrubber; this pins that the one it+ // installs (embed's) still redacts the shapes the old one did.assert_eq!(- scrub_secrets("key: sk-admin-abcdefghijkl"),- "key: [REDACTED]"+ process::sentry::scrub_secrets("Authorization: Bearer abc123xyz"),+ "Authorization: Bearer [REDACTED]");-}--#[test]-fn scrubs_openai_proj_key() {assert_eq!(- scrub_secrets("key: sk-proj-abcdefghijkl"),- "key: [REDACTED]"+ process::sentry::scrub_secrets("api_key=sk-abc123"),+ "api_key=[REDACTED]");}--#[test]-fn scrubs_generic_sk_key() {- assert_eq!(scrub_secrets("sk-abcdefghijklmnopqrstuvwx"), "[REDACTED]");-}--#[test]-fn token_word_boundary_no_false_positive() {- let input = "cancellation_token=abc123 next_page_token=xyz789";- let result = scrub_secrets(input);- assert_eq!(result, input, "should not scrub compound token fields");-}--#[test]-fn standalone_token_is_scrubbed() {- assert_eq!(scrub_secrets("token=secret_value_here"), "token=[REDACTED]");-}