Skip to content

Commit

Permalink
remove duplicate test
Browse files Browse the repository at this point in the history
Signed-off-by: sakshi-1505 <sakshipatle.0808cs171134@gmail.com>
  • Loading branch information
sakshi-1505 committed Oct 15, 2023
1 parent ae17141 commit 13d9bc7
Showing 1 changed file with 3 additions and 61 deletions.
64 changes: 3 additions & 61 deletions pkg/openstack/loadbalancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -646,11 +646,11 @@ func TestLbaasV2_createLoadBalancerStatus(t *testing.T) {
lbaas := &LbaasV2{
LoadBalancer: tt.fields.LoadBalancer,
}
assert.Equal(t, tt.want, lbaas.createLoadBalancerStatus(tt.args.service, tt.args.svcConf, tt.args.addr))
})
assert.Equal(t, tt.want, lbaas.createLoadBalancerStatus(tt.args.service, tt.args.svcConf, tt.args.addr))
})
}
}

func Test_getIntFromServiceAnnotation(t *testing.T) {
type args struct {
service *corev1.Service
Expand Down Expand Up @@ -937,64 +937,6 @@ func Test_buildPoolCreateOpt(t *testing.T) {
})
}
}

func Test_getIntFromServiceAnnotation(t *testing.T) {
type args struct {
service *corev1.Service
annotationKey string
defaultSetting int
}
tests := []struct {
name string
args args
want int
}{
{
name: "return default setting if no service annotation",
args: args{
defaultSetting: 1,
annotationKey: "bar",
service: &corev1.Service{
ObjectMeta: v1.ObjectMeta{
Annotations: map[string]string{"foo": "2"},
},
},
},
want: 1,
},
{
name: "return annotation key if it exists in service annotation",
args: args{
defaultSetting: 1,
annotationKey: "foo",
service: &corev1.Service{
ObjectMeta: v1.ObjectMeta{
Annotations: map[string]string{"foo": "2"},
},
},
},
want: 2,
},
{
name: "return default setting if key isn't valid integer",
args: args{
defaultSetting: 1,
annotationKey: "foo",
service: &corev1.Service{
ObjectMeta: v1.ObjectMeta{
Annotations: map[string]string{"foo": "bar"},
},
},
},
want: 1,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
assert.Equal(t, tt.want, getIntFromServiceAnnotation(tt.args.service, tt.args.annotationKey, tt.args.defaultSetting))
})
}
}
func Test_getSecurityGroupName(t *testing.T) {
tests := []struct {
name string
Expand Down

0 comments on commit 13d9bc7

Please sign in to comment.