MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / command_parses_grpc_rate_limit_flags

Function command_parses_grpc_rate_limit_flags

crates/openshell-server/src/cli.rs:929–949  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

927
928 #[test]
929 fn command_parses_grpc_rate_limit_flags() {
930 let _lock = ENV_LOCK
931 .lock()
932 .unwrap_or_else(std::sync::PoisonError::into_inner);
933 let _g1 = EnvVarGuard::remove("OPENSHELL_GRPC_RATE_LIMIT_REQUESTS");
934 let _g2 = EnvVarGuard::remove("OPENSHELL_GRPC_RATE_LIMIT_WINDOW_SECONDS");
935
936 let cli = Cli::try_parse_from([
937 "openshell-gateway",
938 "--db-url",
939 "sqlite::memory:",
940 "--grpc-rate-limit-requests",
941 "120",
942 "--grpc-rate-limit-window-seconds",
943 "60",
944 ])
945 .unwrap();
946
947 assert_eq!(cli.run.grpc_rate_limit_requests, Some(120));
948 assert_eq!(cli.run.grpc_rate_limit_window_seconds, Some(60));
949 }
950
951 #[test]
952 fn validate_grpc_rate_limit_args_requires_positive_pair() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected