From: garciadeblas Date: Wed, 7 Aug 2024 00:00:53 +0000 (+0200) Subject: Fix coverage and pylint test after updating pip dependencies X-Git-Tag: release-v16.0-start^0 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=HEAD;p=osm%2FPOL.git Fix coverage and pylint test after updating pip dependencies Change-Id: Iacc83ea3c4fdf94ff13f5a793e973a7f8366a44e Signed-off-by: garciadeblas --- diff --git a/osm_policy_module/tests/integration/test_kafka_messages.py b/osm_policy_module/tests/integration/test_kafka_messages.py index 725cc3f..4a55d6e 100644 --- a/osm_policy_module/tests/integration/test_kafka_messages.py +++ b/osm_policy_module/tests/integration/test_kafka_messages.py @@ -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 diff --git a/osm_policy_module/tests/integration/test_policy_agent.py b/osm_policy_module/tests/integration/test_policy_agent.py index 54b4e79..46f0b32 100644 --- a/osm_policy_module/tests/integration/test_policy_agent.py +++ b/osm_policy_module/tests/integration/test_policy_agent.py @@ -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 --- 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