15
0
forked from pool/python-napalm
Files
python-napalm/python-napalm-no-mock.patch

74 lines
2.2 KiB
Diff
Raw Permalink Normal View History

From 9dd413d6254f2dc034903736b65b1853b2163e7d Mon Sep 17 00:00:00 2001
From: Steve Kowalik <steven@wedontsleep.org>
Date: Tue, 10 Dec 2024 12:07:37 +1100
Subject: [PATCH] Remove external mock dependency
Since the minimum version of Python we support contains mock in the
standard library, we should switch to it and remove one external
dependency.
---
requirements-dev.txt | 1 -
test/eos/test_heredoc.py | 2 +-
test/nxos/test_getters.py | 3 ++-
test/nxos_ssh/test_getters.py | 3 ++-
4 files changed, 5 insertions(+), 4 deletions(-)
Index: napalm-5.0.0/requirements-dev.txt
===================================================================
--- napalm-5.0.0.orig/requirements-dev.txt
+++ napalm-5.0.0/requirements-dev.txt
@@ -7,7 +7,6 @@ pytest-cov==5.0.0
pytest-json-report==1.5.0
pyflakes==3.2.0
pylama==8.4.1
-mock==5.1.0
mypy==1.9.0
types-PyYAML==6.0.12.20240311
types-requests==2.31.0.20240406
Index: napalm-5.0.0/test/eos/test_heredoc.py
===================================================================
--- napalm-5.0.0.orig/test/eos/test_heredoc.py
+++ napalm-5.0.0/test/eos/test_heredoc.py
@@ -1,4 +1,4 @@
-import mock
+from unittest import mock
import pytest
from textwrap import dedent
Index: napalm-5.0.0/test/nxos/test_getters.py
===================================================================
--- napalm-5.0.0.orig/test/nxos/test_getters.py
+++ napalm-5.0.0/test/nxos/test_getters.py
@@ -1,11 +1,12 @@
"""Tests for getters."""
+from unittest.mock import patch
+
from napalm.base.test.getters import BaseTestGetters, wrap_test_cases
from napalm.base.test import helpers
Accepting request 1031059 from home:dgarcia:branches:devel:languages:python - Remove empty netmiko-4-support.patch - Update to 4.0.0 Type Hinting ============ - After months of work, @Kircheneer added type hinting support in #1412 and #1476. New features ============ - Add Commit-Confirm support for Cisco IOS #1691 - New encoding argument added to the cli method to return the output of operational / show commands in the desired format. Currently supported on Junos and EOS. #1637 & #1663 - Added ttp_parse helper function to codebase #1563 - Replaced ciscoconfparse with netutils #1565 - New SSH transport available for Arista EOS - thanks @thomasbridge74 #1502 Improvements ============ - Adds mac and ip checks for getters #1560 - The uptime field in the get_facts return is now float type: #1651 - [NX-OS] Improve compare_config for NXOS partial merging #1567 - [EOS] support arbitrary transport class #1643 & #1647 - [EOS] move config lock check to _load_config #1642 - [EOS] Handle modern memory output from Arista EOS 4.27+ #1673 - [IOS-XR] Improving get_facts behavior to handle XML changes in newer OS versions #1667 - [Junos] make sure we don't duplicate LLDP neighbor entries #1640 Bug fixes ========= - [Junos] find for system uptime element #1675 - [IOS-XR] get_lldp_neighbor_details does not support 'N/A' capabilities #1681 - [IOS-XR] get_lldp_neighbor_details add alternative lldp local interface key #1682 - [NX-OS] get_interfaces fix description on SVI interfaces #1571 - [IOS] get_vlans does not return all interfaces if they wrap around in the config #1569 - [Junos] Fix #1549: Check peer admin status from the BGP options #1566 - [EOS] get_bgp_neighbors_detail only returns back a single peer for a certain EOS platform #1573 - Update to 3.4.1 * Pinning to junos-eznc>=2.6.3 OBS-URL: https://build.opensuse.org/request/show/1031059 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-napalm?expand=0&rev=24
2022-10-25 18:12:25 +00:00
from napalm.base import models
import pytest
-from mock import patch
def mock_time():
Index: napalm-5.0.0/test/nxos_ssh/test_getters.py
===================================================================
--- napalm-5.0.0.orig/test/nxos_ssh/test_getters.py
+++ napalm-5.0.0/test/nxos_ssh/test_getters.py
@@ -1,11 +1,12 @@
"""Tests for getters."""
+from unittest.mock import patch
+
from napalm.base.test.getters import BaseTestGetters, wrap_test_cases
from napalm.base.test import helpers
Accepting request 1031059 from home:dgarcia:branches:devel:languages:python - Remove empty netmiko-4-support.patch - Update to 4.0.0 Type Hinting ============ - After months of work, @Kircheneer added type hinting support in #1412 and #1476. New features ============ - Add Commit-Confirm support for Cisco IOS #1691 - New encoding argument added to the cli method to return the output of operational / show commands in the desired format. Currently supported on Junos and EOS. #1637 & #1663 - Added ttp_parse helper function to codebase #1563 - Replaced ciscoconfparse with netutils #1565 - New SSH transport available for Arista EOS - thanks @thomasbridge74 #1502 Improvements ============ - Adds mac and ip checks for getters #1560 - The uptime field in the get_facts return is now float type: #1651 - [NX-OS] Improve compare_config for NXOS partial merging #1567 - [EOS] support arbitrary transport class #1643 & #1647 - [EOS] move config lock check to _load_config #1642 - [EOS] Handle modern memory output from Arista EOS 4.27+ #1673 - [IOS-XR] Improving get_facts behavior to handle XML changes in newer OS versions #1667 - [Junos] make sure we don't duplicate LLDP neighbor entries #1640 Bug fixes ========= - [Junos] find for system uptime element #1675 - [IOS-XR] get_lldp_neighbor_details does not support 'N/A' capabilities #1681 - [IOS-XR] get_lldp_neighbor_details add alternative lldp local interface key #1682 - [NX-OS] get_interfaces fix description on SVI interfaces #1571 - [IOS] get_vlans does not return all interfaces if they wrap around in the config #1569 - [Junos] Fix #1549: Check peer admin status from the BGP options #1566 - [EOS] get_bgp_neighbors_detail only returns back a single peer for a certain EOS platform #1573 - Update to 3.4.1 * Pinning to junos-eznc>=2.6.3 OBS-URL: https://build.opensuse.org/request/show/1031059 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-napalm?expand=0&rev=24
2022-10-25 18:12:25 +00:00
from napalm.base import models
import pytest
-from mock import patch
def mock_time():