mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-12-06 11:03:52 +00:00
test(passthrough): rename the client reset reader helper
Two packages each declared failingReader in the same test package. The passthrough gate test now uses clientResetReader.
This commit is contained in:
@@ -284,13 +284,13 @@ func TestPassthroughCostGate_UnparseableObjectRefused(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
type failingReader struct{}
|
||||
type clientResetReader struct{}
|
||||
|
||||
func (failingReader) Read([]byte) (int, error) { return 0, errors.New("client reset") }
|
||||
func (clientResetReader) Read([]byte) (int, error) { return 0, errors.New("client reset") }
|
||||
|
||||
func TestPassthroughCostGate_WidenedReadErrorIs400(t *testing.T) {
|
||||
e := newGateEnv(t, nil)
|
||||
body := io.MultiReader(strings.NewReader(`{"pad":"`+strings.Repeat("a", maxModelPeekBytes+1024)), failingReader{})
|
||||
body := io.MultiReader(strings.NewReader(`{"pad":"`+strings.Repeat("a", maxModelPeekBytes+1024)), clientResetReader{})
|
||||
req := httptest.NewRequest(http.MethodPost, "/openai/v1/native-endpoint", body)
|
||||
req.ContentLength = -1
|
||||
req.Header.Set("Authorization", "Bearer sk-alice")
|
||||
|
||||
Reference in New Issue
Block a user