Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JimOverholt committed Apr 17, 2024
1 parent 501ec3c commit bbf9a1b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions catalystwan/tests/test_monitoring_server_info.py
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

0 comments on commit bbf9a1b

Please sign in to comment.