Skip to content

Commit

Permalink
nxos: Remove duplicate code for test_get_interfaces
Browse files Browse the repository at this point in the history
Signed-off-by: Guido Trotter <[email protected]>
  • Loading branch information
Guido Trotter committed Jun 20, 2024
1 parent f0efc0b commit ac3999e
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions test/nxos/test_getters.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""Tests for getters."""

from napalm.base.test.getters import BaseTestGetters, wrap_test_cases
from napalm.base.test import helpers
from napalm.base import models
from napalm.base.test.getters import BaseTestGetters

import pytest
from mock import patch
Expand All @@ -16,14 +14,6 @@ def mock_time():
class TestGetter(BaseTestGetters):
"""Test get_* methods."""

@patch("time.time", mock_time)
@wrap_test_cases
def test_get_interfaces(self, test_case):
"""Test get_interfaces."""
get_interfaces = self.device.get_interfaces()
assert len(get_interfaces) > 0

for interface, interface_data in get_interfaces.items():
assert helpers.test_model(models.InterfaceDict, interface_data)

return get_interfaces
test_get_interfaces = patch("time.time", mock_time)(
BaseTestGetters.test_get_interfaces
)

0 comments on commit ac3999e

Please sign in to comment.