Skip to content

Commit

Permalink
Fix UT
Browse files Browse the repository at this point in the history
  • Loading branch information
indraniBh committed Nov 19, 2024
1 parent a6a8c77 commit 5248937
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 155 deletions.
51 changes: 0 additions & 51 deletions gosnappi/generated_invalid_format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1010,57 +1010,6 @@ func TestFlowMetricsIncorrectFormat(t *testing.T) {
assert.NotNil(t, object.Unmarshal().FromJson(incorrect_format))
assert.NotNil(t, object.Unmarshal().FromPbText(incorrect_format))
}
func TestEventLinkIncorrectFormat(t *testing.T) {
incorrect_format := `{
"a":"asdf",
"b" : 65,
"c" : 33,
"h": true,
"response" : "status_200",
"required_object" :
"e_a" : 1,
"e_b" : 2
}`

object := gosnappi.NewEventLink()
assert.NotNil(t, object.Unmarshal().FromYaml(incorrect_format))
assert.NotNil(t, object.Unmarshal().FromJson(incorrect_format))
assert.NotNil(t, object.Unmarshal().FromPbText(incorrect_format))
}
func TestEventRxRateThresholdIncorrectFormat(t *testing.T) {
incorrect_format := `{
"a":"asdf",
"b" : 65,
"c" : 33,
"h": true,
"response" : "status_200",
"required_object" :
"e_a" : 1,
"e_b" : 2
}`

object := gosnappi.NewEventRxRateThreshold()
assert.NotNil(t, object.Unmarshal().FromYaml(incorrect_format))
assert.NotNil(t, object.Unmarshal().FromJson(incorrect_format))
assert.NotNil(t, object.Unmarshal().FromPbText(incorrect_format))
}
func TestEventRouteAdvertiseWithdrawIncorrectFormat(t *testing.T) {
incorrect_format := `{
"a":"asdf",
"b" : 65,
"c" : 33,
"h": true,
"response" : "status_200",
"required_object" :
"e_a" : 1,
"e_b" : 2
}`

object := gosnappi.NewEventRouteAdvertiseWithdraw()
assert.NotNil(t, object.Unmarshal().FromYaml(incorrect_format))
assert.NotNil(t, object.Unmarshal().FromJson(incorrect_format))
assert.NotNil(t, object.Unmarshal().FromPbText(incorrect_format))
}
func TestPortOptionsIncorrectFormat(t *testing.T) {
incorrect_format := `{
"a":"asdf",
Expand Down
54 changes: 0 additions & 54 deletions gosnappi/generated_invalid_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1069,60 +1069,6 @@ func TestFlowMetricsIncorrectKey(t *testing.T) {
assert.NotNil(t, object.Unmarshal().FromJson(incorrect_key))
assert.NotNil(t, object.Unmarshal().FromPbText(incorrect_key))
}
func TestEventLinkIncorrectKey(t *testing.T) {
incorrect_key := `{
"a":"asdf",
"zxnvh" : 65,
"c" : 33,
"h": true,
"response" : "status_200",
"required_object" : {
"e_a" : 1,
"e_b" : 2
}
}`

object := gosnappi.NewEventLink()
assert.NotNil(t, object.Unmarshal().FromYaml(incorrect_key))
assert.NotNil(t, object.Unmarshal().FromJson(incorrect_key))
assert.NotNil(t, object.Unmarshal().FromPbText(incorrect_key))
}
func TestEventRxRateThresholdIncorrectKey(t *testing.T) {
incorrect_key := `{
"a":"asdf",
"zxnvh" : 65,
"c" : 33,
"h": true,
"response" : "status_200",
"required_object" : {
"e_a" : 1,
"e_b" : 2
}
}`

object := gosnappi.NewEventRxRateThreshold()
assert.NotNil(t, object.Unmarshal().FromYaml(incorrect_key))
assert.NotNil(t, object.Unmarshal().FromJson(incorrect_key))
assert.NotNil(t, object.Unmarshal().FromPbText(incorrect_key))
}
func TestEventRouteAdvertiseWithdrawIncorrectKey(t *testing.T) {
incorrect_key := `{
"a":"asdf",
"zxnvh" : 65,
"c" : 33,
"h": true,
"response" : "status_200",
"required_object" : {
"e_a" : 1,
"e_b" : 2
}
}`

object := gosnappi.NewEventRouteAdvertiseWithdraw()
assert.NotNil(t, object.Unmarshal().FromYaml(incorrect_key))
assert.NotNil(t, object.Unmarshal().FromJson(incorrect_key))
assert.NotNil(t, object.Unmarshal().FromPbText(incorrect_key))
}
func TestPortOptionsIncorrectKey(t *testing.T) {
incorrect_key := `{
"a":"asdf",
Expand Down
50 changes: 0 additions & 50 deletions gosnappi/generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12097,56 +12097,6 @@ func TestConfigGenerated(t *testing.T) {
assert.Nil(t, v266.Unmarshal().FromYaml(v266Yaml))
assert.Nil(t, v266.Unmarshal().FromPbText(v266PbText))
v706 := config.Events()
v706.SetEnable(true)
v707 := v706.Link()
v707.SetEnable(true)
v707.HasEnable()
v707.Enable()
v707Json, v707JsonError := v707.Marshal().ToJson()
assert.Nil(t, v707JsonError)
v707Yaml, v707YamlError := v707.Marshal().ToYaml()
assert.Nil(t, v707YamlError)
v707PbText, v707PbTextError := v707.Marshal().ToPbText()
assert.Nil(t, v707PbTextError)
assert.Nil(t, v707.Unmarshal().FromJson(v707Json))
assert.Nil(t, v707.Unmarshal().FromYaml(v707Yaml))
assert.Nil(t, v707.Unmarshal().FromPbText(v707PbText))
v706.SetLink(v707)
v708 := v706.RxRateThreshold()
v708.SetEnable(true).SetThreshold(8)
v708.HasEnable()
v708.HasThreshold()
v708.Enable()
v708.Threshold()
v708Json, v708JsonError := v708.Marshal().ToJson()
assert.Nil(t, v708JsonError)
v708Yaml, v708YamlError := v708.Marshal().ToYaml()
assert.Nil(t, v708YamlError)
v708PbText, v708PbTextError := v708.Marshal().ToPbText()
assert.Nil(t, v708PbTextError)
assert.Nil(t, v708.Unmarshal().FromJson(v708Json))
assert.Nil(t, v708.Unmarshal().FromYaml(v708Yaml))
assert.Nil(t, v708.Unmarshal().FromPbText(v708PbText))
v706.SetRxRateThreshold(v708)
v709 := v706.RouteAdvertiseWithdraw()
v709.SetEnable(true)
v709.HasEnable()
v709.Enable()
v709Json, v709JsonError := v709.Marshal().ToJson()
assert.Nil(t, v709JsonError)
v709Yaml, v709YamlError := v709.Marshal().ToYaml()
assert.Nil(t, v709YamlError)
v709PbText, v709PbTextError := v709.Marshal().ToPbText()
assert.Nil(t, v709PbTextError)
assert.Nil(t, v709.Unmarshal().FromJson(v709Json))
assert.Nil(t, v709.Unmarshal().FromYaml(v709Yaml))
assert.Nil(t, v709.Unmarshal().FromPbText(v709PbText))
v706.SetRouteAdvertiseWithdraw(v709)
v706.HasEnable()
v706.HasLink()
v706.HasRxRateThreshold()
v706.HasRouteAdvertiseWithdraw()
v706.Enable()
v706Json, v706JsonError := v706.Marshal().ToJson()
assert.Nil(t, v706JsonError)
v706Yaml, v706YamlError := v706.Marshal().ToYaml()
Expand Down

0 comments on commit 5248937

Please sign in to comment.