Skip to content

Commit

Permalink
Fix Junos test fixtures after junos-eznc 2.6.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceaulinic committed Jun 16, 2021
1 parent 4bc1565 commit dc90bfe
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 dc90bfe

Please sign in to comment.