Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshaySainiDell committed Nov 12, 2024
1 parent b9a2666 commit af36c04
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions pkg/common/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,49 +441,49 @@ func TestReachableEndPoint(t *testing.T) {
}

func TestGetMountFlags(t *testing.T) {
tests := []struct {
name string
vc *csi.VolumeCapability
expected []string
}{
{
name: "Nil VolumeCapability",
vc: nil,
expected: nil,
},
{
name: "Nil Mount",
vc: &csi.VolumeCapability{},
expected: nil,
},
{
name: "With Mount Flags",
vc: &csi.VolumeCapability{
AccessType: &csi.VolumeCapability_Mount{
Mount: &csi.VolumeCapability_MountVolume{
MountFlags: []string{"ro", "noexec"},
},
},
},
expected: []string{"ro", "noexec"},
},
{
name: "Empty Mount Flags",
vc: &csi.VolumeCapability{
AccessType: &csi.VolumeCapability_Mount{
Mount: &csi.VolumeCapability_MountVolume{
MountFlags: []string{},
},
},
},
expected: []string{},
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result := common.GetMountFlags(tt.vc)
assert.Equal(t, tt.expected, result)
})
}
tests := []struct {
name string
vc *csi.VolumeCapability
expected []string
}{
{
name: "Nil VolumeCapability",
vc: nil,
expected: nil,
},
{
name: "Nil Mount",
vc: &csi.VolumeCapability{},
expected: nil,
},
{
name: "With Mount Flags",
vc: &csi.VolumeCapability{
AccessType: &csi.VolumeCapability_Mount{
Mount: &csi.VolumeCapability_MountVolume{
MountFlags: []string{"ro", "noexec"},
},
},
},
expected: []string{"ro", "noexec"},
},
{
name: "Empty Mount Flags",
vc: &csi.VolumeCapability{
AccessType: &csi.VolumeCapability_Mount{
Mount: &csi.VolumeCapability_MountVolume{
MountFlags: []string{},
},
},
},
expected: []string{},
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result := common.GetMountFlags(tt.vc)
assert.Equal(t, tt.expected, result)
})
}
}

0 comments on commit af36c04

Please sign in to comment.