Skip to content

Commit

Permalink
Merge pull request #120 from CiscoTestAutomation/tasarath_fix_ut_viptela
Browse files Browse the repository at this point in the history
Fix the UT for viptela
  • Loading branch information
Taarini authored and lsheikal committed Feb 22, 2024
1 parent b878bb2 commit d1321bf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/rest/connector/tests/test_viptela.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def test_post_connected(self):

with patch('requests.session') as req:
resp = Response()
resp.raw = MagicMock()
resp.status_code = 200
req().post.return_value = resp
req().get.return_value = resp
Expand All @@ -100,6 +101,7 @@ def test_get_connected(self):

with patch('requests.session') as req:
resp = Response()
resp.raw = MagicMock()
resp.status_code = 200
req().post.return_value = resp
req().get.return_value = resp
Expand All @@ -115,8 +117,10 @@ def test_get_connected_change_expected(self):

with patch('requests.session') as req:
resp = Response()
resp.raw = MagicMock()
resp.status_code = 200
resp2 = Response()
resp2.raw = MagicMock()
resp2.status_code = 300
req().get.side_effect = [resp, resp2]
req().post.side_effect = [resp, resp, resp2]
Expand All @@ -141,6 +145,7 @@ def test_delete_connected(self):

with patch('requests.session') as req:
resp = Response()
resp.raw = MagicMock()
resp.status_code = 200
req().post.return_value = resp
req().get.return_value = resp
Expand All @@ -157,8 +162,10 @@ def test_delete_connected_change_expected(self):

with patch('requests.session') as req:
resp = Response()
resp.raw = MagicMock()
resp.status_code = 200
resp2 = Response()
resp2.raw = MagicMock()
resp2.status_code = 300
req().delete.return_value = resp2
req().post.side_effect = [resp, resp, resp2]
Expand Down

0 comments on commit d1321bf

Please sign in to comment.