Add test cases and data for testing defer-days functionality

This commit is contained in:
Peter Wilhelm 2024-01-07 17:56:17 -06:00
parent 722173bcdc
commit 0d1d7979cb
2 changed files with 67 additions and 0 deletions

View file

@ -79,6 +79,13 @@ func CreateMockContainerWithDigest(id string, name string, image string, created
return c
}
// CreateMockContainerWithDigest should only be used for testing
func CreateMockContainerWithImageCreatedTime(id string, name string, image string, created time.Time, imageCreated time.Time) wt.Container {
c := CreateMockContainer(id, name, image, created)
c.ImageInfo().Created = imageCreated.UTC().Format(time.RFC3339)
return c
}
// CreateMockContainerWithConfig creates a container substitute valid for testing
func CreateMockContainerWithConfig(id string, name string, image string, running bool, restarting bool, created time.Time, config *dockerContainer.Config) wt.Container {
content := types.ContainerJSON{