Skip to content

Commit

Permalink
Rewrite Unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ai-lenok committed Jun 10, 2023
1 parent de5d8c4 commit c8404af
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions maintainer/maintainer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,6 @@ func mockResponse(pathToFile string) error {
return nil
}

func mockResponseArray(pathToFile string) error {
response, err := readResponseArray(pathToFile)
if err != nil {
return err
}
GetDoFunc = func(*http.Request) (*http.Response, error) {
return response, nil
}
return nil
}

func readResponse(pathToFile string) (*http.Response, error) {
file, err := os.ReadFile(pathToFile)
if err != nil {
Expand All @@ -161,6 +150,17 @@ func readResponse(pathToFile string) (*http.Response, error) {
}, nil
}

func mockResponseArray(pathToFile string) error {
response, err := readResponseArray(pathToFile)
if err != nil {
return err
}
GetDoFunc = func(*http.Request) (*http.Response, error) {
return response, nil
}
return nil
}

func readResponseArray(pathToFile string) (*http.Response, error) {
file, err := os.ReadFile(pathToFile)
if err != nil {
Expand Down

0 comments on commit c8404af

Please sign in to comment.