Skip to content

Commit

Permalink
Fix typo.
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Kammel <[email protected]>
  • Loading branch information
datosh committed Aug 12, 2023
1 parent 3539e14 commit b29dd6d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
18 changes: 9 additions & 9 deletions testing/mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ func (d *Device) Product() *spb.SevProduct {
return d.SevProduct
}

// GetResponse controls how often (Occurances) a certain response should be
// GetResponse controls how often (Occurrences) a certain response should be
// provided.
type GetResponse struct {
Occurances uint
Body []byte
Error error
Occurrences uint
Body []byte
Error error
}

// Getter is a mock for HTTPSGetter interface that sequentially
Expand All @@ -175,9 +175,9 @@ func SimpleGetter(responses map[string][]byte) *Getter {
for key, value := range responses {
getter.Responses[key] = []GetResponse{
{
Occurances: ^uint(0),
Body: value,
Error: nil,
Occurrences: ^uint(0),
Body: value,
Error: nil,
},
}
}
Expand All @@ -193,8 +193,8 @@ func (g *Getter) Get(url string) ([]byte, error) {
}
body := resp[0].Body
err := resp[0].Error
resp[0].Occurances--
if resp[0].Occurances == 0 {
resp[0].Occurrences--
if resp[0].Occurrences == 0 {
g.Responses[url] = resp[1:]
}
return body, err
Expand Down
36 changes: 18 additions & 18 deletions verify/trust/trust_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ func TestRetryHTTPSGetter(t *testing.T) {
Responses: map[string][]test.GetResponse{
"https://fetch.me": {
{
Occurances: 1,
Body: []byte("content"),
Error: nil,
Occurrences: 1,
Body: []byte("content"),
Error: nil,
},
},
},
Expand All @@ -50,14 +50,14 @@ func TestRetryHTTPSGetter(t *testing.T) {
Responses: map[string][]test.GetResponse{
"https://fetch.me": {
{
Occurances: 1,
Body: []byte(""),
Error: errors.New("fail"),
Occurrences: 1,
Body: []byte(""),
Error: errors.New("fail"),
},
{
Occurances: 1,
Body: []byte("content"),
Error: nil,
Occurrences: 1,
Body: []byte("content"),
Error: nil,
},
},
},
Expand All @@ -70,14 +70,14 @@ func TestRetryHTTPSGetter(t *testing.T) {
Responses: map[string][]test.GetResponse{
"https://fetch.me": {
{
Occurances: 2,
Body: []byte(""),
Error: errors.New("fail"),
Occurrences: 2,
Body: []byte(""),
Error: errors.New("fail"),
},
{
Occurances: 1,
Body: []byte("content"),
Error: nil,
Occurrences: 1,
Body: []byte("content"),
Error: nil,
},
},
},
Expand Down Expand Up @@ -112,9 +112,9 @@ func TestRetryHTTPSGetterAllFail(t *testing.T) {
Responses: map[string][]test.GetResponse{
"https://fetch.me": {
{
Occurances: 1,
Body: []byte(""),
Error: errors.New("fail"),
Occurrences: 1,
Body: []byte(""),
Error: errors.New("fail"),
},
},
},
Expand Down

0 comments on commit b29dd6d

Please sign in to comment.