Skip to content

Commit

Permalink
Added update flows
Browse files Browse the repository at this point in the history
  • Loading branch information
indraniBh committed Sep 12, 2024
1 parent 5e10ad6 commit 093b3eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
10 changes: 1 addition & 9 deletions snappi_ixnetwork/snappi_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def __init__(self, **kwargs):
self._config_type = self.config()
self._control_state = self.control_state()
self._control_action = self.control_action()
self._flows_update = self.config_update()
self._capture_request = self.capture_request()
self.ixn_routes = []
self.validation = Validation(self)
Expand Down Expand Up @@ -582,11 +583,6 @@ def get_states(self, request):
self._connect()
response = self.ngpf.get_states(request)
states_response = self.states_response()
# if request.choice == "ipv4_neighbors":
# ip_neighbors = states_response.ipv4_neighbors
# else:
# ip_neighbors = states_response.ipv6_neighbors
# ip_neighbors.deserialize(response)
states_response.deserialize(response)
return states_response
except Exception as err:
Expand Down Expand Up @@ -656,10 +652,6 @@ def update_flows(self, payload):
See the docs/openapi.yaml document for all model details
"""
try:
if isinstance(payload, (type(self._flows_update), str)) is False:
raise TypeError(
"The content must be of type Union[UpdateFlows, str]"
)
if isinstance(payload, str) is True:
payload = self._flows_update.deserialize(payload)
self._connect()
Expand Down
5 changes: 2 additions & 3 deletions tests/test_update_flow.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pytest


@pytest.mark.skip(reason="Fix -breaks build - needs investigation")
def test_update_flows(api, b2b_raw_config, utils):
"""
This test is to validate update_flows API
Expand Down Expand Up @@ -61,7 +60,7 @@ def test_update_flows(api, b2b_raw_config, utils):
lambda: stats_ok(api, 2 * 1000, utils), "stats to be as expected"
)

req = api.flows_update()
req = api.config_update().flows
req.property_names = [req.RATE, req.SIZE]

update_flow1 = b2b_raw_config.flows[0]
Expand All @@ -86,7 +85,7 @@ def test_update_flows(api, b2b_raw_config, utils):
)

# Negative test
req = api.flows_update()
req = api.config_update().flows
req.property_names = [req.RATE, req.SIZE]

update_flow1 = b2b_raw_config.flows[0]
Expand Down

0 comments on commit 093b3eb

Please sign in to comment.