Fix coverage and pylint test after updating pip dependencies master v16.0 release-v16.0-start v16.0.0
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 7 Aug 2024 00:00:53 +0000 (02:00 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 7 Aug 2024 00:00:53 +0000 (02:00 +0200)
Change-Id: Iacc83ea3c4fdf94ff13f5a793e973a7f8366a44e
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osm_policy_module/tests/integration/test_kafka_messages.py
osm_policy_module/tests/integration/test_policy_agent.py
tox.ini

index 725cc3f..4a55d6e 100644 (file)
@@ -29,7 +29,7 @@ import sys
 import unittest
 
 from aiokafka import AIOKafkaProducer, AIOKafkaConsumer
-from kafka.errors import KafkaError
+from aiokafka.errors import KafkaError
 
 from osm_policy_module.core.config import Config
 
index 54b4e79..46f0b32 100644 (file)
@@ -29,7 +29,7 @@ import unittest
 import uuid
 from unittest.mock import patch, Mock
 
-from kafka import KafkaProducer
+from aiokafka import AIOKafkaProducer
 from osm_common.dbmongo import DbMongo
 from playhouse.db_url import connect
 
@@ -482,7 +482,7 @@ class PolicyModuleAgentTest(unittest.TestCase):
         os.remove("test_db.sqlite")
 
     @patch.object(DbMongo, "db_connect", Mock())
-    @patch.object(KafkaProducer, "__init__")
+    @patch.object(AIOKafkaProducer, "__init__")
     @patch.object(MonClient, "create_alarm")
     @patch.object(CommonDbClient, "get_vnfd")
     @patch.object(CommonDbClient, "get_nsr")
@@ -566,7 +566,7 @@ class PolicyModuleAgentTest(unittest.TestCase):
         self.assertEqual(scaling_record.nsr_id, "test_nsr_id")
 
     @patch.object(DbMongo, "db_connect", Mock())
-    @patch.object(KafkaProducer, "__init__")
+    @patch.object(AIOKafkaProducer, "__init__")
     @patch.object(MonClient, "create_alarm")
     @patch.object(CommonDbClient, "get_vnfd")
     @patch.object(CommonDbClient, "get_nsr")
@@ -617,7 +617,7 @@ class PolicyModuleAgentTest(unittest.TestCase):
         )
 
     @patch.object(DbMongo, "db_connect", Mock())
-    @patch.object(KafkaProducer, "__init__")
+    @patch.object(AIOKafkaProducer, "__init__")
     @patch.object(MonClient, "create_alarm")
     @patch.object(CommonDbClient, "get_vnfd")
     @patch.object(CommonDbClient, "get_nsr")
diff --git a/tox.ini b/tox.ini
index 33d241e..ffbc713 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -62,7 +62,7 @@ commands =
 deps =  {[testenv]deps}
         -r{toxinidir}/requirements-dev.txt
         -r{toxinidir}/requirements-test.txt
-        pylint
+        pylint==3.2.2
 commands =
         pylint -E osm_policy_module