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.
- Loading branch information
1 parent
501ec3c
commit bbf9a1b
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
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,26 @@ | ||
# Copyright 2022 Cisco Systems, Inc. and its affiliates | ||
|
||
import unittest | ||
from unittest.mock import MagicMock, patch | ||
|
||
from catalystwan.endpoints.monitoring.server_info import ServerInfo | ||
|
||
|
||
class TestServerInfo(unittest.TestCase): | ||
def test_get_server_info(self): | ||
# Arrange | ||
self.api._endpoints.get_server_info.return_value = self.server_info_response | ||
# Act | ||
result = self.api.get_server_info() | ||
# Assert | ||
assert result == self.server_info_response | ||
|
||
|
||
@patch("catalystwan.session.ManagerSession") | ||
@patch("catalystwan.response.ManagerResponse") | ||
def setUp(self, mock_session, mock_response) -> None: | ||
self.server_info_response = {'Achitecture': 'amd64', 'Available processors': 8} | ||
self.session = mock_session | ||
self.api = ServerInfo(self.session) | ||
self.api._endpoints = MagicMock() | ||
mock_response.json.return_value = self.server_info_response |