Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nxos: Remove duplicate code for test_get_interfaces #2104

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
)