test: fully reset ghttp server (#1121)

pull/1114/head
nils måsén 3 years ago committed by GitHub
parent 1b405d4c77
commit 0060cd6ee4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save