mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-16 23:20:12 +01:00
feature/112: add additional tests that verify include-stopped
This commit is contained in:
parent
46ffa16ee2
commit
3c2e184823
1 changed files with 23 additions and 10 deletions
|
|
@ -17,15 +17,16 @@ func TestContainer(t *testing.T) {
|
|||
|
||||
var _ = Describe("the container", func() {
|
||||
Describe("the client", func() {
|
||||
var docker *cli.Client
|
||||
var client Client
|
||||
BeforeSuite(func() {
|
||||
server := mocks.NewMockAPIServer()
|
||||
c, _ := cli.NewClientWithOpts(
|
||||
docker, _ = cli.NewClientWithOpts(
|
||||
cli.WithHost(server.URL),
|
||||
cli.WithHTTPClient(server.Client(),
|
||||
))
|
||||
client = dockerClient{
|
||||
api: c,
|
||||
api: docker,
|
||||
pullImages: false,
|
||||
}
|
||||
})
|
||||
|
|
@ -55,6 +56,18 @@ var _ = Describe("the container", func() {
|
|||
Expect(containers[0].ImageName()).To(Equal("containrrr/watchtower:latest"))
|
||||
})
|
||||
})
|
||||
When(`listing containers with the "include stopped" option`, func() {
|
||||
It("should return both stopped and running containers", func() {
|
||||
client = dockerClient{
|
||||
api: docker,
|
||||
pullImages: false,
|
||||
includeStopped: true,
|
||||
}
|
||||
containers, err := client.ListContainers(noFilter)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(len(containers) > 0).To(BeTrue())
|
||||
})
|
||||
})
|
||||
})
|
||||
When("asked for metadata", func() {
|
||||
var c *Container
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue