Skip to content

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
Yashk767 committed Nov 7, 2022
1 parent 4e5e4ca commit dfda319
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"razor/utils/mocks"
"reflect"
"testing"
"time"
)

func getAPIByteArray(index int) []byte {
Expand Down Expand Up @@ -98,7 +99,8 @@ func TestGetDataFromAPI(t *testing.T) {
utils := StartRazor(optionsPackageStruct)

ioMock.On("ReadAll", mock.Anything).Return(tt.args.body, tt.args.bodyErr)
got, err := utils.GetDataFromAPI(tt.args.url, &cache.LocalCache{})
localCache := cache.NewLocalCache(time.Second * 10)
got, err := utils.GetDataFromAPI(tt.args.url, localCache)
if (err != nil) != tt.wantErr {
t.Errorf("GetDataFromAPI() error = %v, wantErr %v", err, tt.wantErr)
return
Expand Down

0 comments on commit dfda319

Please sign in to comment.