- use pytest instead of nose and replace deprecated yamlordereddictloader by yamlloader - added patches: + python-junos-eznc-remove-nose.patch + python-junos-eznc-remove-yamlordereddictloader.patch OBS-URL: https://build.opensuse.org/request/show/835384 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-junos-eznc?expand=0&rev=16
1214 lines
42 KiB
Diff
1214 lines
42 KiB
Diff
Index: py-junos-eznc-2.5.3/tests/functional/test_core.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/functional/test_core.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/functional/test_core.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -4,11 +4,11 @@ try:
|
|
import unittest2 as unittest
|
|
except ImportError:
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from jnpr.junos.exception import RpcTimeoutError
|
|
|
|
|
|
-@attr("functional")
|
|
+@pytest.mark.functional
|
|
class TestCore(unittest.TestCase):
|
|
@classmethod
|
|
def setUpClass(self):
|
|
Index: py-junos-eznc-2.5.3/tests/functional/test_device_ssh.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/functional/test_device_ssh.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/functional/test_device_ssh.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -1,12 +1,12 @@
|
|
__author__ = "rsherman, vnitinv"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
|
|
from jnpr.junos import Device
|
|
|
|
|
|
-@attr("functional")
|
|
+@pytest.mark.functional
|
|
class TestDeviceSsh(unittest.TestCase):
|
|
def tearDown(self):
|
|
self.dev.close()
|
|
Index: py-junos-eznc-2.5.3/tests/functional/test_outbound_ssh.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/functional/test_outbound_ssh.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/functional/test_outbound_ssh.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -1,13 +1,13 @@
|
|
__author__ = "mwiget"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
|
|
import socket
|
|
from jnpr.junos import Device
|
|
|
|
|
|
-@attr("functional")
|
|
+@pytest.mark.functional
|
|
class TestDeviceSsh(unittest.TestCase):
|
|
def tearDown(self):
|
|
self.dev.close()
|
|
Index: py-junos-eznc-2.5.3/tests/functional/test_table.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/functional/test_table.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/functional/test_table.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -4,13 +4,13 @@ try:
|
|
import unittest2 as unittest
|
|
except ImportError:
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
|
|
from jnpr.junos.op.routes import RouteTable
|
|
import json
|
|
|
|
|
|
-@attr("functional")
|
|
+@pytest.mark.functional
|
|
class TestTable(unittest.TestCase):
|
|
@classmethod
|
|
def setUpClass(self):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/__init__.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/__init__.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/__init__.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -1,14 +1,14 @@
|
|
import unittest
|
|
import sys
|
|
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch
|
|
|
|
__author__ = "Nitin Kumar"
|
|
__credits__ = "Jeremy Schulman"
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestJunosInit(unittest.TestCase):
|
|
def test_warning(self):
|
|
with patch.object(sys.modules["sys"], "version_info", (2, 6, 3)) as mock_sys:
|
|
Index: py-junos-eznc-2.5.3/tests/unit/factory/test_cfgtable.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/factory/test_cfgtable.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/factory/test_cfgtable.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -5,7 +5,7 @@ import unittest
|
|
import os
|
|
import sys
|
|
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
import yaml
|
|
|
|
from jnpr.junos import Device
|
|
@@ -85,7 +85,7 @@ yaml_bgp_data = """---
|
|
globals().update(FactoryLoader().load(yaml.load(yaml_bgp_data, Loader=yaml.FullLoader)))
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
@unittest.skipIf(sys.platform == "win32", "will work for windows in coming days")
|
|
class TestFactoryCfgTable(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
Index: py-junos-eznc-2.5.3/tests/unit/factory/test_cmdtable.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/factory/test_cmdtable.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/factory/test_cmdtable.py 2020-09-18 10:58:14.163423506 +0200
|
|
@@ -3,7 +3,7 @@ __credits__ = "Jeremy Schulman"
|
|
|
|
import unittest
|
|
import os
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
|
|
from jnpr.junos import Device
|
|
from jnpr.junos.exception import RpcError
|
|
@@ -17,7 +17,7 @@ import yaml
|
|
import json
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestFactoryCMDTable(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/factory/test_factory_cls.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/factory/test_factory_cls.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/factory/test_factory_cls.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -2,13 +2,13 @@ __author__ = "Rick Sherman"
|
|
__credits__ = "Jeremy Schulman"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
|
|
from jnpr.junos.factory.factory_cls import FactoryCfgTable, FactoryOpTable
|
|
from jnpr.junos.factory.factory_cls import FactoryTable, FactoryView
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestFactoryCls(unittest.TestCase):
|
|
def test_factory_cls_cfgtable(self):
|
|
t = FactoryCfgTable()
|
|
Index: py-junos-eznc-2.5.3/tests/unit/factory/test_factory_loader.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/factory/test_factory_loader.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/factory/test_factory_loader.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -2,12 +2,12 @@ __author__ = "Rick Sherman, Nitin Kumar"
|
|
__credits__ = "Jeremy Schulman"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from jnpr.junos.factory import FactoryLoader
|
|
from mock import patch
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestFactoryLoader(unittest.TestCase):
|
|
def setUp(self):
|
|
self.fl = FactoryLoader()
|
|
Index: py-junos-eznc-2.5.3/tests/unit/factory/test_optable.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/factory/test_optable.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/factory/test_optable.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -5,7 +5,7 @@ import unittest
|
|
import os
|
|
import yaml
|
|
import json
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
|
|
from jnpr.junos import Device
|
|
from jnpr.junos.op.phyport import PhyPortStatsTable
|
|
@@ -22,7 +22,7 @@ from lxml import etree
|
|
from mock import patch
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestFactoryOpTable(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/factory/test_table.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/factory/test_table.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/factory/test_table.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Rick Sherman, Nitin Kumar"
|
|
__credits__ = "Jeremy Schulman"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
import os
|
|
|
|
from jnpr.junos import Device
|
|
@@ -23,7 +23,7 @@ else:
|
|
builtin_string = "builtins"
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestFactoryTable(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/factory/test_to_json.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/factory/test_to_json.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/factory/test_to_json.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -4,7 +4,7 @@ try:
|
|
import unittest2 as unittest
|
|
except ImportError:
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch
|
|
import os
|
|
import json
|
|
@@ -21,7 +21,7 @@ from ncclient.transport import SSHSessio
|
|
from ncclient.operations.rpc import RPCReply
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestToJson(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/factory/test_view.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/factory/test_view.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/factory/test_view.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Rick Sherman, Nitin Kumar"
|
|
__credits__ = "Jeremy Schulman"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import MagicMock, patch
|
|
from jnpr.junos import Device
|
|
from jnpr.junos.factory.view import View
|
|
@@ -10,7 +10,7 @@ from jnpr.junos.op.phyport import PhyPor
|
|
from lxml import etree
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestFactoryView(unittest.TestCase):
|
|
def setUp(self):
|
|
self.dev = Device(
|
|
Index: py-junos-eznc-2.5.3/tests/unit/factory/test_view_fields.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/factory/test_view_fields.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/factory/test_view_fields.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -2,12 +2,12 @@ __author__ = "Rick Sherman"
|
|
__credits__ = "Jeremy Schulman"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
|
|
from jnpr.junos.factory.viewfields import ViewFields
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestFactoryViewFields(unittest.TestCase):
|
|
def setUp(self):
|
|
self.vf = ViewFields()
|
|
Index: py-junos-eznc-2.5.3/tests/unit/facts/test__init__.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/facts/test__init__.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/facts/test__init__.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -5,14 +5,14 @@ try:
|
|
import unittest2 as unittest
|
|
except ImportError:
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
import importlib
|
|
import sys
|
|
|
|
import jnpr.junos.facts
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestFactInitialization(unittest.TestCase):
|
|
def test_duplicate_facts(self):
|
|
module = importlib.import_module("tests.unit.facts.dupe_foo1")
|
|
Index: py-junos-eznc-2.5.3/tests/unit/facts/test_current_re.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/facts/test_current_re.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/facts/test_current_re.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Stacy Smith"
|
|
__credits__ = "Jeremy Schulman, Nitin Kumar"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch, MagicMock
|
|
import os
|
|
from lxml import etree
|
|
@@ -14,7 +14,7 @@ from ncclient.manager import Manager, ma
|
|
from ncclient.transport import SSHSession
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestCurrentRe(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/facts/test_domain.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/facts/test_domain.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/facts/test_domain.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Stacy Smith"
|
|
__credits__ = "Jeremy Schulman, Nitin Kumar"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch, MagicMock
|
|
import os
|
|
from lxml import etree
|
|
@@ -14,7 +14,7 @@ from ncclient.manager import Manager, ma
|
|
from ncclient.transport import SSHSession
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestDomain(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/facts/test_ethernet_mac_table.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/facts/test_ethernet_mac_table.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/facts/test_ethernet_mac_table.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Stacy Smith"
|
|
__credits__ = "Jeremy Schulman, Nitin Kumar"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch, MagicMock
|
|
import os
|
|
from lxml import etree
|
|
@@ -14,7 +14,7 @@ from ncclient.manager import Manager, ma
|
|
from ncclient.transport import SSHSession
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestEthernetMacTable(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/facts/test_file_list.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/facts/test_file_list.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/facts/test_file_list.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Stacy Smith"
|
|
__credits__ = "Jeremy Schulman, Nitin Kumar"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch, MagicMock
|
|
import os
|
|
|
|
@@ -12,7 +12,7 @@ from ncclient.manager import Manager, ma
|
|
from ncclient.transport import SSHSession
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestFileList(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/facts/test_get_chassis_cluster_status.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/facts/test_get_chassis_cluster_status.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/facts/test_get_chassis_cluster_status.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Stacy Smith"
|
|
__credits__ = "Jeremy Schulman, Nitin Kumar"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch, MagicMock
|
|
import os
|
|
from lxml import etree
|
|
@@ -14,7 +14,7 @@ from ncclient.manager import Manager, ma
|
|
from ncclient.transport import SSHSession
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestGetChassisClusterStatus(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/facts/test_get_chassis_inventory.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/facts/test_get_chassis_inventory.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/facts/test_get_chassis_inventory.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Stacy Smith"
|
|
__credits__ = "Jeremy Schulman, Nitin Kumar"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch, MagicMock
|
|
import os
|
|
|
|
@@ -12,7 +12,7 @@ from ncclient.manager import Manager, ma
|
|
from ncclient.transport import SSHSession
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestChassis(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/facts/test_get_route_engine_information.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/facts/test_get_route_engine_information.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/facts/test_get_route_engine_information.py 2020-09-18 10:55:50.666532679 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Stacy Smith"
|
|
__credits__ = "Jeremy Schulman, Nitin Kumar"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch, MagicMock
|
|
import os
|
|
from lxml import etree
|
|
@@ -13,7 +13,7 @@ from ncclient.manager import Manager, ma
|
|
from ncclient.transport import SSHSession
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestGetRouteEngineInformation(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/facts/test_get_software_information.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/facts/test_get_software_information.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/facts/test_get_software_information.py 2020-09-18 10:55:50.670532704 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Stacy Smith"
|
|
__credits__ = "Jeremy Schulman, Nitin Kumar"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch, MagicMock
|
|
import os
|
|
from lxml import etree
|
|
@@ -14,7 +14,7 @@ from ncclient.manager import Manager, ma
|
|
from ncclient.transport import SSHSession
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestGetSoftwareInformation(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/facts/test_get_virtual_chassis_information.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/facts/test_get_virtual_chassis_information.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/facts/test_get_virtual_chassis_information.py 2020-09-18 10:55:50.670532704 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Stacy Smith"
|
|
__credits__ = "Jeremy Schulman, Nitin Kumar"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch, MagicMock
|
|
import os
|
|
import sys
|
|
@@ -15,7 +15,7 @@ from ncclient.manager import Manager, ma
|
|
from ncclient.transport import SSHSession
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestGetVirtualChassisInformation(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/facts/test_ifd_style.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/facts/test_ifd_style.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/facts/test_ifd_style.py 2020-09-18 10:55:50.670532704 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Stacy Smith"
|
|
__credits__ = "Jeremy Schulman, Nitin Kumar"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch, MagicMock
|
|
import os
|
|
from lxml import etree
|
|
@@ -14,7 +14,7 @@ from ncclient.manager import Manager, ma
|
|
from ncclient.transport import SSHSession
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestIfdStyle(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/facts/test_iri_mapping.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/facts/test_iri_mapping.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/facts/test_iri_mapping.py 2020-09-18 10:55:50.670532704 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Stacy Smith"
|
|
__credits__ = "Jeremy Schulman, Nitin Kumar"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch, MagicMock
|
|
import os
|
|
|
|
@@ -12,7 +12,7 @@ from ncclient.manager import Manager, ma
|
|
from ncclient.transport import SSHSession
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestIriMapping(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/facts/test_personality.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/facts/test_personality.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/facts/test_personality.py 2020-09-18 10:55:50.670532704 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Stacy Smith"
|
|
__credits__ = "Jeremy Schulman, Nitin Kumar"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch, MagicMock
|
|
import os
|
|
from jnpr.junos.exception import RpcError
|
|
@@ -13,7 +13,7 @@ from ncclient.manager import Manager, ma
|
|
from ncclient.transport import SSHSession
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestPersonality(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/facts/test_swver.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/facts/test_swver.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/facts/test_swver.py 2020-09-18 10:55:50.670532704 +0200
|
|
@@ -7,12 +7,12 @@ try:
|
|
import unittest2 as unittest
|
|
except:
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
|
|
from jnpr.junos.facts.swver import version_info, get_facts
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestVersionInfo(unittest.TestCase):
|
|
if six.PY2:
|
|
assertCountEqual = unittest.TestCase.assertItemsEqual
|
|
Index: py-junos-eznc-2.5.3/tests/unit/ofacts/test_chassis.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/ofacts/test_chassis.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/ofacts/test_chassis.py 2020-09-18 10:55:50.670532704 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Nitin Kumar, Rick Sherman"
|
|
__credits__ = "Jeremy Schulman"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch, MagicMock
|
|
from lxml import etree
|
|
import os
|
|
@@ -16,7 +16,7 @@ from ncclient.manager import Manager, ma
|
|
from ncclient.transport import SSHSession
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestChassis(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
@patch("jnpr.junos.device.warnings")
|
|
Index: py-junos-eznc-2.5.3/tests/unit/ofacts/test_domain.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/ofacts/test_domain.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/ofacts/test_domain.py 2020-09-18 10:55:50.670532704 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Nitin Kumar, Rick Sherman"
|
|
__credits__ = "Jeremy Schulman"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch, MagicMock
|
|
from lxml import etree
|
|
|
|
@@ -11,7 +11,7 @@ from jnpr.junos import Device
|
|
from jnpr.junos.exception import RpcError
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestDomain(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
@patch("jnpr.junos.device.warnings")
|
|
Index: py-junos-eznc-2.5.3/tests/unit/ofacts/test_ifd_style.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/ofacts/test_ifd_style.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/ofacts/test_ifd_style.py 2020-09-18 10:55:50.670532704 +0200
|
|
@@ -3,13 +3,13 @@ __credits__ = "Jeremy Schulman"
|
|
|
|
import unittest
|
|
from mock import patch
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
|
|
from jnpr.junos import Device
|
|
from jnpr.junos.ofacts.ifd_style import facts_ifd_style as ifd_style
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestIFDStyle(unittest.TestCase):
|
|
@patch("jnpr.junos.device.warnings")
|
|
def setUp(self, mock_warnings):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/ofacts/test_personality.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/ofacts/test_personality.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/ofacts/test_personality.py 2020-09-18 10:55:50.670532704 +0200
|
|
@@ -3,13 +3,13 @@ __credits__ = "Jeremy Schulman"
|
|
|
|
import unittest
|
|
from mock import patch
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
|
|
from jnpr.junos import Device
|
|
from jnpr.junos.ofacts.personality import facts_personality as personality
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestPersonality(unittest.TestCase):
|
|
@patch("jnpr.junos.device.warnings")
|
|
def setUp(self, mock_warnings):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/ofacts/test_routing_engines.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/ofacts/test_routing_engines.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/ofacts/test_routing_engines.py 2020-09-18 10:55:50.670532704 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Nitin Kumar, Rick Sherman"
|
|
__credits__ = "Jeremy Schulman"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch, MagicMock
|
|
import os
|
|
import sys
|
|
@@ -14,7 +14,7 @@ from ncclient.manager import Manager, ma
|
|
from ncclient.transport import SSHSession
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestRoutingEngines(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
@patch("jnpr.junos.device.warnings")
|
|
Index: py-junos-eznc-2.5.3/tests/unit/ofacts/test_srx_cluster.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/ofacts/test_srx_cluster.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/ofacts/test_srx_cluster.py 2020-09-18 10:55:50.670532704 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Nitin Kumar, Rick Sherman"
|
|
__credits__ = "Jeremy Schulman"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch
|
|
import os
|
|
|
|
@@ -13,7 +13,7 @@ from ncclient.manager import Manager, ma
|
|
from ncclient.transport import SSHSession
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestSrxCluster(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
@patch("jnpr.junos.device.warnings")
|
|
Index: py-junos-eznc-2.5.3/tests/unit/ofacts/test_switch_style.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/ofacts/test_switch_style.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/ofacts/test_switch_style.py 2020-09-18 10:55:50.670532704 +0200
|
|
@@ -3,13 +3,13 @@ __credits__ = "Jeremy Schulman"
|
|
|
|
import unittest
|
|
from mock import patch
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
|
|
from jnpr.junos import Device
|
|
from jnpr.junos.ofacts.switch_style import facts_switch_style as switch_style
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestSwitchStyle(unittest.TestCase):
|
|
@patch("jnpr.junos.device.warnings")
|
|
def setUp(self, mock_warnings):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/ofacts/test_swver.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/ofacts/test_swver.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/ofacts/test_swver.py 2020-09-18 10:55:50.670532704 +0200
|
|
@@ -5,7 +5,7 @@ try:
|
|
import unittest2 as unittest
|
|
except ImportError:
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch, MagicMock
|
|
import os
|
|
|
|
@@ -17,7 +17,7 @@ from ncclient.transport import SSHSessio
|
|
from jnpr.junos.exception import RpcError
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestSwver(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
@patch("jnpr.junos.device.warnings")
|
|
Index: py-junos-eznc-2.5.3/tests/unit/test_console.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/test_console.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/test_console.py 2020-09-18 10:55:50.702532904 +0200
|
|
@@ -3,7 +3,7 @@ try:
|
|
except ImportError:
|
|
import unittest
|
|
from jnpr.junos.utils.config import Config
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch, MagicMock, call
|
|
import re
|
|
import sys
|
|
@@ -23,7 +23,7 @@ else:
|
|
builtin_string = "builtins"
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestConsole(unittest.TestCase):
|
|
@patch("jnpr.junos.transport.tty_telnet.Telnet._tty_open")
|
|
@patch("jnpr.junos.transport.tty_telnet.telnetlib.Telnet.expect")
|
|
Index: py-junos-eznc-2.5.3/tests/unit/test_decorators.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/test_decorators.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/test_decorators.py 2020-09-18 10:55:50.714532979 +0200
|
|
@@ -2,7 +2,7 @@ try:
|
|
import unittest2 as unittest
|
|
except ImportError:
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
|
|
from lxml.etree import XML
|
|
|
|
@@ -22,7 +22,7 @@ from ncclient.xml_ import qualify
|
|
__author__ = "Rick Sherman"
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class Test_Decorators(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/test_device.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/test_device.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/test_device.py 2020-09-18 10:55:50.722533029 +0200
|
|
@@ -2,7 +2,7 @@ try:
|
|
import unittest2 as unittest
|
|
except ImportError:
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import MagicMock, patch, mock_open, call
|
|
import os
|
|
from lxml import etree
|
|
@@ -53,7 +53,7 @@ facts = {
|
|
}
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class Test_MyTemplateLoader(unittest.TestCase):
|
|
def setUp(self):
|
|
from jnpr.junos.device import _MyTemplateLoader
|
|
@@ -78,7 +78,7 @@ class Test_MyTemplateLoader(unittest.Tes
|
|
self.template_loader.get_source(None, None)
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestDevice(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/test_exception.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/test_exception.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/test_exception.py 2020-09-18 10:55:50.730533079 +0200
|
|
@@ -1,5 +1,5 @@
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from jnpr.junos.exception import (
|
|
RpcError,
|
|
CommitError,
|
|
@@ -81,7 +81,7 @@ config_json = """{
|
|
}"""
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class Test_RpcError(unittest.TestCase):
|
|
def test_rpcerror_repr(self):
|
|
rsp = etree.XML(rpc_xml)
|
|
Index: py-junos-eznc-2.5.3/tests/unit/test_factcache.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/test_factcache.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/test_factcache.py 2020-09-18 10:55:50.738533129 +0200
|
|
@@ -2,7 +2,7 @@ try:
|
|
import unittest2 as unittest
|
|
except ImportError:
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch, MagicMock, call
|
|
from jnpr.junos.exception import FactLoopError
|
|
|
|
@@ -15,7 +15,7 @@ __author__ = "Stacy Smith"
|
|
__credits__ = "Jeremy Schulman, Nitin Kumar"
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestFactCache(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/test_junos.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/test_junos.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/test_junos.py 2020-09-18 10:55:50.746533179 +0200
|
|
@@ -3,14 +3,14 @@
|
|
import unittest
|
|
import sys
|
|
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch
|
|
|
|
__author__ = "Nitin Kumar"
|
|
__credits__ = "Jeremy Schulman"
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestJunosInit(unittest.TestCase):
|
|
def test_warning(self):
|
|
with patch.object(sys.modules["sys"], "version_info", (2, 6, 3)) as mock_sys:
|
|
Index: py-junos-eznc-2.5.3/tests/unit/test_jxml.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/test_jxml.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/test_jxml.py 2020-09-18 10:55:50.754533228 +0200
|
|
@@ -1,7 +1,7 @@
|
|
import os
|
|
import unittest
|
|
from io import StringIO
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import patch
|
|
from jnpr.junos.jxml import (
|
|
NAME,
|
|
@@ -17,7 +17,7 @@ __author__ = "Nitin Kumar, Rick Sherman"
|
|
__credits__ = "Jeremy Schulman"
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class Test_JXML(unittest.TestCase):
|
|
def test_name(self):
|
|
op = NAME("test")
|
|
Index: py-junos-eznc-2.5.3/tests/unit/test_rpcmeta.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/test_rpcmeta.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/test_rpcmeta.py 2020-09-18 10:55:50.762533278 +0200
|
|
@@ -1,7 +1,7 @@
|
|
import unittest
|
|
import os
|
|
import re
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
|
|
from jnpr.junos.device import Device
|
|
from jnpr.junos.rpcmeta import _RpcMetaExec
|
|
@@ -17,7 +17,7 @@ __author__ = "Nitin Kumar, Rick Sherman"
|
|
__credits__ = "Jeremy Schulman"
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class Test_RpcMetaExec(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/transport/test_serial.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/transport/test_serial.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/transport/test_serial.py 2020-09-18 10:55:50.762533278 +0200
|
|
@@ -2,7 +2,7 @@ try:
|
|
import unittest2 as unittest
|
|
except ImportError:
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import MagicMock, patch
|
|
import sys
|
|
import six
|
|
@@ -15,7 +15,7 @@ else:
|
|
builtin_string = "builtins"
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestSerial(unittest.TestCase):
|
|
@patch("jnpr.junos.transport.tty_serial.serial.Serial.open")
|
|
@patch("jnpr.junos.transport.tty_serial.serial.Serial.write")
|
|
@@ -77,7 +77,7 @@ class TestSerial(unittest.TestCase):
|
|
self.assertEqual(self.dev._tty.read_prompt()[0], None)
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestSerialWin(unittest.TestCase):
|
|
@patch("jnpr.junos.transport.tty_serial.serial.Serial.open")
|
|
@patch("jnpr.junos.transport.tty_serial.serial.Serial.read")
|
|
Index: py-junos-eznc-2.5.3/tests/unit/transport/test_tty.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/transport/test_tty.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/transport/test_tty.py 2020-09-18 10:55:50.762533278 +0200
|
|
@@ -5,14 +5,14 @@ try:
|
|
except ImportError:
|
|
import unittest
|
|
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import MagicMock, patch
|
|
|
|
from jnpr.junos.transport.tty import Terminal
|
|
from jnpr.junos import exception as EzErrors
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestTTY(unittest.TestCase):
|
|
def setUp(self):
|
|
logging.getLogger("jnpr.junos.tty")
|
|
Index: py-junos-eznc-2.5.3/tests/unit/transport/test_tty_netconf.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/transport/test_tty_netconf.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/transport/test_tty_netconf.py 2020-09-18 10:55:50.762533278 +0200
|
|
@@ -2,7 +2,7 @@ try:
|
|
import unittest2 as unittest
|
|
except ImportError:
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import MagicMock, patch
|
|
from jnpr.junos.transport.tty_netconf import tty_netconf
|
|
import six
|
|
@@ -12,7 +12,7 @@ import socket
|
|
from ncclient.operations import RPCError
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestTTYNetconf(unittest.TestCase):
|
|
def setUp(self):
|
|
self.tty_net = tty_netconf(MagicMock())
|
|
Index: py-junos-eznc-2.5.3/tests/unit/transport/test_tty_ssh.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/transport/test_tty_ssh.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/transport/test_tty_ssh.py 2020-09-18 10:55:50.762533278 +0200
|
|
@@ -5,12 +5,12 @@ try:
|
|
import unittest2 as unittest
|
|
except ImportError:
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import MagicMock, patch
|
|
from jnpr.junos.transport.tty_ssh import SSH
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestTTYSSH(unittest.TestCase):
|
|
@patch("jnpr.junos.transport.tty_ssh.paramiko")
|
|
def setUp(self, mock_paramiko):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/transport/test_tty_telnet.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/transport/test_tty_telnet.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/transport/test_tty_telnet.py 2020-09-18 10:55:50.762533278 +0200
|
|
@@ -4,13 +4,13 @@ try:
|
|
import unittest2 as unittest
|
|
except ImportError:
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from mock import MagicMock, patch
|
|
from jnpr.junos.transport.tty_telnet import Telnet
|
|
import six
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestTTYTelnet(unittest.TestCase):
|
|
@patch("jnpr.junos.transport.tty_telnet.telnetlib.Telnet")
|
|
def setUp(self, mpock_telnet):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/utils/test_config.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/utils/test_config.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/utils/test_config.py 2020-09-18 10:55:50.766533303 +0200
|
|
@@ -1,6 +1,6 @@
|
|
import unittest
|
|
import sys
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
|
|
from jnpr.junos import Device
|
|
from jnpr.junos.utils.config import Config
|
|
@@ -32,7 +32,7 @@ else:
|
|
builtin_string = "builtins"
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestConfig(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/utils/test_fs.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/utils/test_fs.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/utils/test_fs.py 2020-09-18 10:55:50.766533303 +0200
|
|
@@ -1,5 +1,5 @@
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
import os
|
|
|
|
from ncclient.manager import Manager, make_device_handler
|
|
@@ -16,7 +16,7 @@ __author__ = "Nitin Kumar, Rick Sherman"
|
|
__credits__ = "Jeremy Schulman"
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestFS(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/utils/test_ftp.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/utils/test_ftp.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/utils/test_ftp.py 2020-09-18 10:55:50.766533303 +0200
|
|
@@ -1,5 +1,5 @@
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
import ftplib
|
|
import sys
|
|
import os
|
|
@@ -15,7 +15,7 @@ else:
|
|
builtin_string = "builtins"
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
@unittest.skipIf(sys.platform == "win32", "will work for windows in coming days")
|
|
class TestFtp(unittest.TestCase):
|
|
@patch("ftplib.FTP.connect")
|
|
Index: py-junos-eznc-2.5.3/tests/unit/utils/test_scp.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/utils/test_scp.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/utils/test_scp.py 2020-09-18 10:55:50.766533303 +0200
|
|
@@ -3,7 +3,7 @@ from six import StringIO
|
|
from contextlib import contextmanager
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
|
|
from jnpr.junos import Device
|
|
from jnpr.junos.utils.scp import SCP
|
|
@@ -19,7 +19,7 @@ else:
|
|
builtin_string = "builtins"
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestScp(unittest.TestCase):
|
|
def setUp(self):
|
|
self.dev = Device(host="1.1.1.1")
|
|
Index: py-junos-eznc-2.5.3/tests/unit/utils/test_start_shell.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/utils/test_start_shell.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/utils/test_start_shell.py 2020-09-18 10:55:50.766533303 +0200
|
|
@@ -1,5 +1,5 @@
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
|
|
from jnpr.junos import Device
|
|
from jnpr.junos.utils.start_shell import StartShell
|
|
@@ -10,7 +10,7 @@ __author__ = "Rick Sherman"
|
|
__credits__ = "Jeremy Schulman, Nitin Kumar"
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestStartShell(unittest.TestCase):
|
|
@patch("paramiko.SSHClient")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/utils/test_sw.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/utils/test_sw.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/utils/test_sw.py 2020-09-18 10:55:50.766533303 +0200
|
|
@@ -7,7 +7,7 @@ try:
|
|
import unittest2 as unittest
|
|
except ImportError:
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
from contextlib import contextmanager
|
|
from jnpr.junos import Device
|
|
from jnpr.junos.exception import RpcError, SwRollbackError, RpcTimeoutError
|
|
@@ -59,7 +59,7 @@ facts = {
|
|
}
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestSW(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/tests/unit/utils/test_util.py
|
|
===================================================================
|
|
--- py-junos-eznc-2.5.3.orig/tests/unit/utils/test_util.py 2020-08-25 11:35:29.000000000 +0200
|
|
+++ py-junos-eznc-2.5.3/tests/unit/utils/test_util.py 2020-09-18 10:55:50.766533303 +0200
|
|
@@ -2,7 +2,7 @@ __author__ = "Nitin Kumar, Rick Sherman"
|
|
__credits__ = "Jeremy Schulman"
|
|
|
|
import unittest
|
|
-from nose.plugins.attrib import attr
|
|
+import pytest
|
|
|
|
from jnpr.junos import Device
|
|
from jnpr.junos.utils.util import Util
|
|
@@ -10,7 +10,7 @@ from jnpr.junos.utils.util import Util
|
|
from mock import patch
|
|
|
|
|
|
-@attr("unit")
|
|
+@pytest.mark.unit
|
|
class TestUtil(unittest.TestCase):
|
|
@patch("ncclient.manager.connect")
|
|
def setUp(self, mock_connect):
|
|
Index: py-junos-eznc-2.5.3/pytest.ini
|
|
===================================================================
|
|
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
|
+++ py-junos-eznc-2.5.3/pytest.ini 2020-09-18 11:02:32.057024480 +0200
|
|
@@ -0,0 +1,4 @@
|
|
+[pytest]
|
|
+markers =
|
|
+ unit
|
|
+ functional
|