From b3642db0d7c1d076100a16e9f346511d443d6689 Mon Sep 17 00:00:00 2001 From: ajasnosz Date: Thu, 19 Dec 2024 10:48:55 +0100 Subject: [PATCH] test: add unit tests --- test/snmp/test_tasks.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/snmp/test_tasks.py b/test/snmp/test_tasks.py index f17415004..51eca3efb 100644 --- a/test/snmp/test_tasks.py +++ b/test/snmp/test_tasks.py @@ -292,10 +292,10 @@ def test_trap_reverse_dns_lookup( @patch("splunk_connect_for_snmp.snmp.tasks.IPv6_ENABLED", True) # @patch("splunk_connect_for_snmp.snmp.manager.Poller.__init__") - # @patch("time.time") + @patch("time.time") def test_format_ipv4_address( self, - # m_time, + m_time, # m_poller, ipv6_enabled, m_mongo_client, @@ -303,18 +303,18 @@ def test_format_ipv4_address( # m_poller.return_value = None from splunk_connect_for_snmp.snmp.tasks import format_ipv4_address - # m_time.return_value = 1640692955.365186 + m_time.return_value = 1640692955.365186 ip_address = "::ffff:172.31.20.76" host = format_ipv4_address(ip_address) self.assertEqual(host, "172.31.20.76") # @patch("splunk_connect_for_snmp.snmp.manager.Poller.__init__") - # @patch("time.time") + @patch("time.time") # @patch("splunk_connect_for_snmp.snmp.tasks.IPv6_ENABLED", False) def test_format_ipv4_address_disabled( self, - # m_time, + m_time, # m_poller, # ipv6_enabled, m_mongo_client, @@ -329,11 +329,11 @@ def test_format_ipv4_address_disabled( self.assertEqual(host, "::ffff:172.31.20.76") # @patch("splunk_connect_for_snmp.snmp.manager.Poller.__init__") - # @patch("time.time") + @patch("time.time") # @patch("splunk_connect_for_snmp.snmp.tasks.IPv6_ENABLED", True) def test_format_ipv4_address_ipv6( self, - # m_time, + m_time, # m_poller, # ipv6_enabled, m_mongo_client, @@ -341,7 +341,7 @@ def test_format_ipv4_address_ipv6( # m_poller.return_value = None from splunk_connect_for_snmp.snmp.tasks import format_ipv4_address - # m_time.return_value = 1640692955.365186 + m_time.return_value = 1640692955.365186 ip_address = "fd02::b24a:409e:a35e:b580" host = format_ipv4_address(ip_address)