-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
describegpt: add tests #1114
Comments
@jqnatividad For the invalid key I set a random value in test test_describegpt::invalid_api_key ... FAILED
failures:
---- test_describegpt::invalid_api_key stdout ----
thread 'test_describegpt::invalid_api_key' panicked at 'assertion failed: `(left == right)`
left: `"Generating stats from in.csv using qsv stats --everything...\nGenerating frequency from in.csv using qsv frequency...\nInteracting with OpenAI API...\n\nGenerating tags from OpenAI API...\nOpenAI API Error: {\"message\":\"Incorrect API key provided: asdfasfadssf. You can find your API
key at https://platform.openai.com/account/api-keys.\",\"type\":\"invalid_request_error\",\"param\":null,\"code\":\"invalid_api_key\"}\n"`,
right: `""`', tests\test_describegpt.rs:25:5 |
Hi @rzmk , You can do something like this: let mut cmd = wrk.command("describegpt");
cmd.arg("--all").arg("--json").args(["--openai-key","INVALIDKEY"]).arg("in.csv");
let output = cmd.output().unwrap();
let got_stderr= std::str::from_utf8(&output.stderr).unwrap_or_default();
assert!(
got_stderr.contains("Incorrect API key provided: INVALIDKEY"))
); |
jqnatividad
added a commit
that referenced
this issue
Jul 7, 2023
describegpt: add testing (resolves #1114)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🗺 Overview
Add tests to qsv's
describegpt
command.📌 Tasks
--user-agent
option, get the expected user-agent in the header#[ignore]
that fetches a successful response (setQSV_OPENAI_KEY
in local env var)The text was updated successfully, but these errors were encountered: