test: fully reset ghttp server (#1121)

This commit is contained in:
nils måsén 2021-11-02 16:53:56 +01:00 committed by GitHub
parent 1b405d4c77
commit 0060cd6ee4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,14 +22,14 @@ import (
var _ = Describe("the client", func() {
var docker *cli.Client
var mockServer *ghttp.Server
BeforeSuite(func() {
BeforeEach(func() {
mockServer = ghttp.NewServer()
docker, _ = cli.NewClientWithOpts(
cli.WithHost(mockServer.URL()),
cli.WithHTTPClient(mockServer.HTTPTestServer.Client()))
})
AfterEach(func() {
mockServer.Reset()
mockServer.Close()
})
Describe("WarnOnHeadPullFailed", func() {
containerUnknown := *mockContainerWithImageName("unknown.repo/prefix/imagename:latest")