Skip to content

Commit 9bf3cc4

Browse files
authored
Merge pull request #1467 from napalm-automation/junos-eznc-2.6.1
Fix Junos test fixtures after junos-eznc 2.6.1 release
2 parents 4bc1565 + dc90bfe commit 9bf3cc4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/junos/conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
from napalm.junos import junos
1212

13+
from ncclient.devices.junos import JunosDeviceHandler
14+
1315

1416
@pytest.fixture(scope="class")
1517
def set_device_parameters(request):
@@ -82,6 +84,15 @@ def __init__(self):
8284
# disable it to use the DOM parser which was used prior.
8385
self._use_filter = False
8486

87+
@property
88+
def transform(self):
89+
# Junos device transform, inherited from the ncclient class
90+
return self._conn._device_handler.transform_reply
91+
92+
@transform.setter
93+
def transform(self, func):
94+
self._conn._device_handler.transform_reply = func
95+
8596
@property
8697
def facts(self):
8798
# we want to reinitialize it every time to avoid side effects
@@ -183,6 +194,7 @@ class FakeConnection:
183194
def __init__(self, rpc):
184195
self.rpc = FakeConnectionRPCObject(rpc)
185196
self._session = FakeSession()
197+
self._device_handler = JunosDeviceHandler({})
186198

187199

188200
class FakeSession:

0 commit comments

Comments
 (0)