test: TestSecret_Equal
This commit is contained in:
parent
0d91cdcc6f
commit
5ee7bb462c
@ -157,6 +157,47 @@ func TestNetworkIPAM_Config(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSecret_Config(t *testing.T) {
|
||||||
|
require := require.New(t)
|
||||||
|
|
||||||
|
testCases := []struct {
|
||||||
|
equalableA dockerCompose.Equalable
|
||||||
|
equalableB dockerCompose.Equalable
|
||||||
|
expectedResult bool
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
equalableA: &dockerCompose.Secret{},
|
||||||
|
equalableB: &dockerCompose.Service{},
|
||||||
|
expectedResult: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
equalableA: &dockerCompose.Secret{},
|
||||||
|
equalableB: nil,
|
||||||
|
expectedResult: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
equalableA: &dockerCompose.Secret{
|
||||||
|
File: "/var/run/docker/app/secret",
|
||||||
|
},
|
||||||
|
equalableB: &dockerCompose.Secret{},
|
||||||
|
expectedResult: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
equalableA: &dockerCompose.Secret{
|
||||||
|
File: "/var/run/docker/app/secret",
|
||||||
|
},
|
||||||
|
equalableB: &dockerCompose.Secret{
|
||||||
|
File: "/var/run/docker/app/secret",
|
||||||
|
},
|
||||||
|
expectedResult: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for i, testCase := range testCases {
|
||||||
|
require.Equal(testCase.expectedResult, testCase.equalableA.Equal(testCase.equalableB), "Failed test case %v", i)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestServiceDeployResourcesLimits_Equal(t *testing.T) {
|
func TestServiceDeployResourcesLimits_Equal(t *testing.T) {
|
||||||
require := require.New(t)
|
require := require.New(t)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user