use crate::e2e::config::CallConfig;
use crate::e2e::fixture::Fixture;
pub(super) fn streaming_call_expr_and_flag(
fixture: &Fixture,
call: &CallConfig,
call_prefix: &str,
function_name: &str,
args: &str,
) -> (String, bool) {
let is_streaming =
crate::e2e::codegen::streaming_assertions::resolve_is_streaming(fixture, call.streaming_enabled());
if !is_streaming {
return (format!("{call_prefix}.{function_name}({args})"), false);
}
let ctx_args = if args.is_empty() {
"context.Background()".to_string()
} else {
format!("context.Background(), {args}")
};
(format!("{call_prefix}.{function_name}WithContext({ctx_args})"), true)
}