Skip to content

Commit

Permalink
Merge pull request #1467 from napalm-automation/junos-eznc-2.6.1
Browse files Browse the repository at this point in the history
Fix Junos test fixtures after junos-eznc 2.6.1 release
  • Loading branch information
mirceaulinic authored Jun 16, 2021
2 parents 4bc1565 + dc90bfe commit 9bf3cc4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/junos/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

from napalm.junos import junos

from ncclient.devices.junos import JunosDeviceHandler


@pytest.fixture(scope="class")
def set_device_parameters(request):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -183,6 +194,7 @@ class FakeConnection:
def __init__(self, rpc):
self.rpc = FakeConnectionRPCObject(rpc)
self._session = FakeSession()
self._device_handler = JunosDeviceHandler({})


class FakeSession:
Expand Down

0 comments on commit 9bf3cc4

Please sign in to comment.