This change will vendor the new version of the exoscale-import post-processor component, but remove all of its code from Packer. After the v1.8.0 release this change should be removed entirely. This vendor process is being used as a workaround for decoupling the exoscale-import component without causing a breaking change in Packer. Users of Exoscale are encouraged to leverage `packer init` for installing the latest version of packer-plugin-exoscale.
29 lines
459 B
Go
29 lines
459 B
Go
package publicapi
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/jarcoal/httpmock"
|
|
"github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
type MockClient struct {
|
|
mock.Mock
|
|
*httpmock.MockTransport
|
|
ClientWithResponsesInterface
|
|
}
|
|
|
|
func NewMockClient() *MockClient {
|
|
var c MockClient
|
|
|
|
c.MockTransport = httpmock.NewMockTransport()
|
|
|
|
return &c
|
|
}
|
|
|
|
func (c *MockClient) Do(req *http.Request) (*http.Response, error) {
|
|
hc := http.Client{Transport: c.MockTransport}
|
|
|
|
return hc.Do(req)
|
|
}
|