Skip to content

Commit

Permalink
changing few files
Browse files Browse the repository at this point in the history
  • Loading branch information
NishantSinghhhhh committed Jan 11, 2025
1 parent 5ef3e17 commit 1530c74
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions tests/switchmap_/dashboard/net/html/pages/test_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
import sys
import unittest
from unittest.mock import patch

# Try to create a working PYTHONPATH
EXEC_DIR = os.path.dirname(os.path.realpath(__file__))
Expand Down Expand Up @@ -163,14 +162,31 @@ def test_interfaces(self):
"""Testing function interfaces."""
# Initialize key variables
expected = """<table class="table">
<thead><tr><th>Port</th><th>VLAN</th><th>State</th><th>Days Inactive</th><th>Speed</th><th>Duplex</th><th>Port Label</th><th>Trunk</th><th>CDP</th><th>LLDP</th><th>Mac Address</th><th>Manufacturer</th><th>IP Address</th><th>DNS Name</th></tr></thead>
<tbody>
<tr class="success"><td>Gi1/0/1</td><td>21</td><td>Active</td><td></td><td>1G</td><td>Full</td><td>Alias F12</td><td>False</td><td></td><td></td><td>d05099dad28b</td><td></td><td><p></p></td><td><p></p></td></tr>
</tbody>
</table>""" # noqa: E501
<thead><tr><th>Port</th><th>VLAN</th><th>State</th><th>Days Inactive</th><th>Speed</th><th>Duplex</th><th>Port Label</th><th>Trunk</th><th>CDP</th><th>LLDP</th><th>Mac Address</th><th>Manufacturer</th><th>IP Address</th><th>DNS Name</th></tr></thead>
<tbody>
<tr class="success"><td>Gi1/0/1</td><td>21</td><td>Active</td><td></td><td>1G</td><td>Full</td><td>Alias F12</td><td>False</td><td></td><td></td><td>d05099dad28b</td><td></td><td><p></p></td><td><p></p></td></tr>
</tbody>
</table>"""
result = self.device.interfaces()
self.assertEqual(result, expected)

def test_system(self):
"""Testing function system."""
# Initialize key variables
expected = """<table class="table">
<thead class="tblHead"><tr><th>Parameter</th><th>Value</th></tr></thead>
<tbody>
<tr><td>System Name</td><td>device-01.example.org</td></tr>
<tr><td>System Hostname</td><td>device-01.example.org</td></tr>
<tr><td>System Description</td><td>Cisco IOS Software, C3750E Software (C3750E-UNIVERSALK9-M), Version<br>15.0(2)SE11, RELEASE SOFTWARE (fc3) Technical Support:<br>http://www.cisco.com/techsupport Copyright (c) 1986-2017 by Cisco<br>Systems, Inc. Compiled Sat 19-Aug-17 08:39 by prod_rel_team</td></tr>
<tr><td>System sysObjectID</td><td>.1.3.6.1.4.1.9.1.516</td></tr>
<tr><td>System Uptime</td><td>94 Days, 18:39:06</td></tr>
<tr><td>Time Last Polled</td><td>2023-02-23 15:13:37</td></tr>
</tbody>
</table>"""
result = self.device.system()
self.assertEqual(result, expected)


class TestInterfaceTable(unittest.TestCase):
"""Checks all functions and methods."""
Expand Down

0 comments on commit 1530c74

Please sign in to comment.