Merge pull request #5980 from thaJeztah/container_use_subtests

cli/command/container: TestNewCreateCommandWithContentTrustErrors use subtests
This commit is contained in:
Sebastiaan van Stijn 2025-04-01 16:24:05 +02:00 committed by GitHub
commit 33494921b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -248,6 +248,7 @@ func TestNewCreateCommandWithContentTrustErrors(t *testing.T) {
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
fakeCLI := test.NewFakeCli(&fakeClient{
createContainerFunc: func(config *container.Config,
hostConfig *container.HostConfig,
@ -265,6 +266,7 @@ func TestNewCreateCommandWithContentTrustErrors(t *testing.T) {
cmd.SetArgs(tc.args)
err := cmd.Execute()
assert.ErrorContains(t, err, tc.expectedError)
})
}
}