MCPcopy
hub / github.com/git-lfs/git-lfs / TestRetriableReaderMakesErrorsRetriable

Function TestRetriableReaderMakesErrorsRetriable

tools/iotools_test.go:34–46  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func TestRetriableReaderMakesErrorsRetriable(t *testing.T) {
35 expected := errors.New("example error")
36
37 r := tools.NewRetriableReader(&ErrReader{expected})
38
39 var buf [1]byte
40 n, err := r.Read(buf[:])
41
42 assert.Equal(t, 0, n)
43 assert.EqualError(t, err, "LFS: "+expected.Error())
44 assert.True(t, errors.IsRetriableError(err))
45
46}
47
48func TestRetriableReaderDoesNotRewrap(t *testing.T) {
49 // expected is already "retriable", as would be the case if the

Callers

nothing calls this directly

Calls 6

ReadMethod · 0.95
NewFunction · 0.92
NewRetriableReaderFunction · 0.92
IsRetriableErrorFunction · 0.92
ErrorMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected