go-openai icon indicating copy to clipboard operation
go-openai copied to clipboard

Refactor/internal testing

Open rexposadas opened this issue 1 year ago • 1 comments

See issue: https://github.com/sashabaranov/go-openai/issues/186

Add helpers in order to reduce boilerplate code in the tests.

To test this PR run the tests: go test ./....

rexposadas avatar Mar 23 '23 09:03 rexposadas

Codecov Report

Merging #194 (bfdc083) into master (2ebb265) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #194   +/-   ##
=======================================
  Coverage   71.84%   71.84%           
=======================================
  Files          21       21           
  Lines         579      579           
=======================================
  Hits          416      416           
  Misses        124      124           
  Partials       39       39           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Mar 23 '23 16:03 codecov[bot]

Excellent work, thank you so much!

QQ: do we even need to factor checks into a subpackage? Single import of test and calls like test.NoError(t, err, "ListEngines error") seems like a nice API, what do you think?

sashabaranov avatar Mar 23 '23 19:03 sashabaranov

Excellent work, thank you so much!

QQ: do we even need to factor checks into a subpackage? Single import of test and calls like test.NoError(t, err, "ListEngines error") seems like a nice API, what do you think?

Good question. I didn't want the name to be too close with the std testing package.

But if that worry is unwarranted, I can refactor it. I'm fine either way.

rexposadas avatar Mar 24 '23 13:03 rexposadas

Got it, makes sense!

sashabaranov avatar Mar 24 '23 17:03 sashabaranov