This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update README.md * Update README.md * Update README.md * Update README.md * Add default None values to the Tier model (#16) * Fix: admintech wait (#17) * version check and model update for user * admin tech - wait for file ready * get token * correct logic * Add default None values to the Tier model (#16) --------- Co-authored-by: Nikhil <[email protected]> Co-authored-by: PrzeG <[email protected]> * fix admintech, generate endpoints md for new release (#18) * generate endpoints md * fix admintech api and unittests * Update README.md * Update versions_utils.py ``` -------------------------------------------------- nExpress_mtt.test_nExpress_mtt_verify_provider_software_upgrade_data -------------------------------------------------- verify_provider_software_upgrade_vmanage(PROVIDER) [PASS] "All VManages updated correctly." verify_provider_software_upgrade_vbond(PROVIDER) [PASS] "All VBonds updated correctly." verify_set_default_partition_for_vbond(PROVIDER) [PASS] "Successfully set the default version for partition." ``` * Update versions_utils.py * Update versions_utils.py * Update versions_utils.py * Merge branch 'main' into JimOverholt-patch-1 * Merge pull request #20 from cisco-open/JimOverholt-patch-1 Update README.md * Release 0.33.3 * server_info * monitoring * monitoring * tests * unit-test * dev release 0.33.3dev0 prep --------- Co-authored-by: JimOverholt <[email protected]> Co-authored-by: PrzeG <[email protected]> Co-authored-by: Nikhil <[email protected]> Co-authored-by: Piotr Smialkowski <[email protected]> Co-authored-by: Jim Overholt <[email protected]>
- Loading branch information
1 parent
3020907
commit da90d8f
Showing
16 changed files
with
566 additions
and
453 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright 2024 Cisco Systems, Inc. and its affiliates | ||
|
||
# mypy: disable-error-code="empty-body" | ||
|
||
from catalystwan.endpoints import APIEndpoints, get | ||
from catalystwan.models.monitoring.server_info import ServerInfoResponse | ||
|
||
|
||
class ServerInfo(APIEndpoints): | ||
@get("/server/info") | ||
def get_server_info(self) -> ServerInfoResponse: | ||
... |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright 2024 Cisco Systems, Inc. and its affiliates | ||
|
||
from pydantic import BaseModel, Field | ||
|
||
|
||
class ServerInfoResponse(BaseModel): | ||
"""The response may contain an incorrect spelling "Achitecture".""" | ||
|
||
architecture: str = Field(..., alias="Achitecture") | ||
available_processors: int = Field( | ||
..., serialization_alias="Available processors", validation_alias="Available processors" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Copyright 2022 Cisco Systems, Inc. and its affiliates | ||
|
||
import unittest | ||
from unittest.mock import MagicMock, patch | ||
|
||
from catalystwan.endpoints.monitoring.server_info import ServerInfo | ||
from catalystwan.models.monitoring.server_info import ServerInfoResponse | ||
|
||
|
||
class TestServerInfo(unittest.TestCase): | ||
def setUp(self) -> None: | ||
self.mock_server_info_data = { | ||
"Achitecture": "x86_64", | ||
"Available processors": 4, | ||
} # Note the spelling error | ||
|
||
@patch("catalystwan.session.ManagerSession") | ||
def test_get_server_info(self, mock_session): | ||
# Arrange | ||
# Create a MagicMock for the response that has a dataobj method | ||
mock_response = MagicMock() | ||
# Set up the mock response's dataobj method to return a ServerInfoResponse | ||
mock_response.dataobj.return_value = ServerInfoResponse(**self.mock_server_info_data) | ||
|
||
# Mock the request method of the ManagerSession to return the mock response | ||
mock_session_instance = mock_session.return_value | ||
mock_session_instance.request.return_value = mock_response | ||
|
||
server_info_api = ServerInfo(mock_session_instance) | ||
|
||
# Act | ||
response = server_info_api.get_server_info() | ||
|
||
# Assert | ||
self.assertIsInstance(response, ServerInfoResponse) | ||
self.assertEqual(response.architecture, self.mock_server_info_data["Achitecture"]) | ||
self.assertEqual( | ||
response.available_processors, | ||
self.mock_server_info_data["Available processors"], | ||
) | ||
self.assertEqual(response.architecture, "x86_64") | ||
self.assertEqual(response.available_processors, 4) | ||
|
||
# Ensure the request method was called | ||
mock_session_instance.request.assert_called_once() | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "catalystwan" | ||
version = "0.33.0dev0" | ||
version = "0.33.3dev0" | ||
description = "Cisco Catalyst WAN SDK for Python" | ||
authors = ["kagorski <[email protected]>"] | ||
readme = "README.md" | ||
|