From dc90bfec0a897d0f02e9ff8e3f47bfe58746e362 Mon Sep 17 00:00:00 2001 From: Mircea Ulinic Date: Wed, 16 Jun 2021 12:48:06 +0100 Subject: [PATCH] Fix Junos test fixtures after junos-eznc 2.6.1 release --- test/junos/conftest.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/junos/conftest.py b/test/junos/conftest.py index cca77f03e..a0a057328 100644 --- a/test/junos/conftest.py +++ b/test/junos/conftest.py @@ -10,6 +10,8 @@ from napalm.junos import junos +from ncclient.devices.junos import JunosDeviceHandler + @pytest.fixture(scope="class") def set_device_parameters(request): @@ -82,6 +84,15 @@ def __init__(self): # disable it to use the DOM parser which was used prior. self._use_filter = False + @property + def transform(self): + # Junos device transform, inherited from the ncclient class + return self._conn._device_handler.transform_reply + + @transform.setter + def transform(self, func): + self._conn._device_handler.transform_reply = func + @property def facts(self): # we want to reinitialize it every time to avoid side effects @@ -183,6 +194,7 @@ class FakeConnection: def __init__(self, rpc): self.rpc = FakeConnectionRPCObject(rpc) self._session = FakeSession() + self._device_handler = JunosDeviceHandler({}) class FakeSession: