diff --git a/uniconfig/python/tests/test_device_discovery.py b/uniconfig/python/tests/test_device_discovery.py index d35febd..24dad6e 100644 --- a/uniconfig/python/tests/test_device_discovery.py +++ b/uniconfig/python/tests/test_device_discovery.py @@ -4,8 +4,9 @@ from frinx_api.uniconfig.device.discovery.discover import TcpPortItem from frinx_api.uniconfig.device.discovery.discover import UdpPortItem -# from frinx_worker.uniconfig.device_discovery import DeviceDiscoveryWorkers -from uniconfig.python.frinx_worker.uniconfig.device_discovery import DeviceDiscoveryWorkers # type: ignore +from frinx_worker.uniconfig.device_discovery import DeviceDiscoveryWorkers + +# from uniconfig.python.frinx_worker.uniconfig.device_discovery import DeviceDiscoveryWorkers # type: ignore class TestDeviceDiscovery(unittest.TestCase): @@ -14,7 +15,7 @@ def test_tcp_validation_list(self) -> None: tcp_port = '21,22,23' expected = [TcpPortItem(port=21), TcpPortItem(port=22), TcpPortItem(port=23)] result = (DeviceDiscoveryWorkers. - DeviceDiscoveryWorker.WorkerInput.validate_tcp(tcp_port=tcp_port)) + DeviceDiscoveryWorker.WorkerInput.validate_tcp(tcp_port=tcp_port)) # type: ignore assert expected == result assert isinstance(result, list) @@ -22,7 +23,7 @@ def test_tcp_validation_range(self) -> None: tcp_port = '21-23' expected = [TcpPortItem(port=21), TcpPortItem(port=22), TcpPortItem(port=23)] result = (DeviceDiscoveryWorkers. - DeviceDiscoveryWorker.WorkerInput.validate_tcp(tcp_port=tcp_port)) + DeviceDiscoveryWorker.WorkerInput.validate_tcp(tcp_port=tcp_port)) # type: ignore assert expected == result assert isinstance(result, list) @@ -30,7 +31,7 @@ def test_tcp_validation_list_range(self) -> None: tcp_port = '21-23,25' expected = [TcpPortItem(port=21), TcpPortItem(port=22), TcpPortItem(port=23), TcpPortItem(port=25)] result = (DeviceDiscoveryWorkers. - DeviceDiscoveryWorker.WorkerInput.validate_tcp(tcp_port=tcp_port)) + DeviceDiscoveryWorker.WorkerInput.validate_tcp(tcp_port=tcp_port)) # type: ignore assert expected == result assert isinstance(result, list) @@ -38,7 +39,7 @@ def test_udp_validation_list(self) -> None: udp_port = '21,22,23' expected = [UdpPortItem(port=21), UdpPortItem(port=22), UdpPortItem(port=23)] result = (DeviceDiscoveryWorkers. - DeviceDiscoveryWorker.WorkerInput.validate_udp(udp_port=udp_port)) + DeviceDiscoveryWorker.WorkerInput.validate_udp(udp_port=udp_port)) # type: ignore assert expected == result assert isinstance(result, list) @@ -46,7 +47,7 @@ def test_udp_validation_range(self) -> None: udp_port = '21-23' expected = [UdpPortItem(port=21), UdpPortItem(port=22), UdpPortItem(port=23)] result = (DeviceDiscoveryWorkers. - DeviceDiscoveryWorker.WorkerInput.validate_udp(udp_port=udp_port)) + DeviceDiscoveryWorker.WorkerInput.validate_udp(udp_port=udp_port)) # type: ignore assert expected == result assert isinstance(result, list) @@ -54,7 +55,7 @@ def test_udp_validation_list_range(self) -> None: udp_port = '21-23,25' expected = [UdpPortItem(port=21), UdpPortItem(port=22), UdpPortItem(port=23), UdpPortItem(port=25)] result = (DeviceDiscoveryWorkers. - DeviceDiscoveryWorker.WorkerInput.validate_udp(udp_port=udp_port)) + DeviceDiscoveryWorker.WorkerInput.validate_udp(udp_port=udp_port)) # type: ignore assert expected == result assert isinstance(result, list) @@ -63,7 +64,7 @@ def test_validate_ip_single_ip_v4(self) -> None: expected = [Address(end_ipv6_address=None, ip_address='192.168.0.59', hostname=None, end_ipv4_address=None, start_ipv4_address=None, start_ipv6_address=None, network=None)] result = (DeviceDiscoveryWorkers. - DeviceDiscoveryWorker.WorkerInput.validate_ip(ip=ip)) + DeviceDiscoveryWorker.WorkerInput.validate_ip(ip=ip)) # type: ignore assert expected == result assert isinstance(result, list) @@ -73,7 +74,7 @@ def test_validate_ip_range_ip_v4(self) -> None: end_ipv6_address=None, ip_address=None, hostname=None, end_ipv4_address='192.168.0.90', start_ipv4_address='192.168.0.59', start_ipv6_address=None, network=None)] result = (DeviceDiscoveryWorkers. - DeviceDiscoveryWorker.WorkerInput.validate_ip(ip=ip)) + DeviceDiscoveryWorker.WorkerInput.validate_ip(ip=ip)) # type: ignore assert expected == result assert isinstance(result, list) @@ -83,7 +84,7 @@ def test_validate_ip_network_v4(self) -> None: end_ipv6_address=None, ip_address=None, hostname=None, end_ipv4_address=None, start_ipv4_address=None, start_ipv6_address=None, network='192.168.0.0/24')] result = (DeviceDiscoveryWorkers. - DeviceDiscoveryWorker.WorkerInput.validate_ip(ip=ip)) + DeviceDiscoveryWorker.WorkerInput.validate_ip(ip=ip)) # type: ignore assert expected == result assert isinstance(result, list) @@ -92,7 +93,7 @@ def test_validate_ip_single_ip_v6(self) -> None: expected = [Address(end_ipv6_address=None, ip_address='::ffff:c0a8:3b', hostname=None, end_ipv4_address=None, start_ipv4_address=None, start_ipv6_address=None, network=None)] result = (DeviceDiscoveryWorkers. - DeviceDiscoveryWorker.WorkerInput.validate_ip(ip=ip)) + DeviceDiscoveryWorker.WorkerInput.validate_ip(ip=ip)) # type: ignore assert expected == result assert isinstance(result, list) @@ -100,7 +101,7 @@ def test_validate_ip_single_ip_v6(self) -> None: expected = [Address(end_ipv6_address=None, ip_address='::ffff:c0a8:3b', hostname=None, end_ipv4_address=None, start_ipv4_address=None, start_ipv6_address=None, network=None)] result = (DeviceDiscoveryWorkers. - DeviceDiscoveryWorker.WorkerInput.validate_ip(ip=ip)) + DeviceDiscoveryWorker.WorkerInput.validate_ip(ip=ip)) # type: ignore assert expected == result assert isinstance(result, list) @@ -110,7 +111,7 @@ def test_validate_ip_range_ip_v6(self) -> None: end_ipv6_address='::ffff:c0a8:5a', ip_address=None, hostname=None, end_ipv4_address=None, start_ipv4_address=None, start_ipv6_address='::ffff:c0a8:3b', network=None)] result = (DeviceDiscoveryWorkers. - DeviceDiscoveryWorker.WorkerInput.validate_ip(ip=ip)) + DeviceDiscoveryWorker.WorkerInput.validate_ip(ip=ip)) # type: ignore assert expected == result assert isinstance(result, list) @@ -119,7 +120,7 @@ def test_validate_ip_range_ip_v6(self) -> None: end_ipv6_address='::ffff:c0a8:5a', ip_address=None, hostname=None, end_ipv4_address=None, start_ipv4_address=None, start_ipv6_address='::ffff:c0a8:3b', network=None)] result = (DeviceDiscoveryWorkers. - DeviceDiscoveryWorker.WorkerInput.validate_ip(ip=ip)) + DeviceDiscoveryWorker.WorkerInput.validate_ip(ip=ip)) # type: ignore assert expected == result assert isinstance(result, list) @@ -129,7 +130,7 @@ def test_validate_ip_network_v6(self) -> None: end_ipv6_address=None, ip_address=None, hostname=None, end_ipv4_address=None, start_ipv4_address=None, start_ipv6_address=None, network='::ffff:c0a8:0/128')] result = (DeviceDiscoveryWorkers. - DeviceDiscoveryWorker.WorkerInput.validate_ip(ip)) + DeviceDiscoveryWorker.WorkerInput.validate_ip(ip=ip)) # type: ignore assert expected == result assert isinstance(result, list)