Change-Id: Iacc83ea3c4fdf94ff13f5a793e973a7f8366a44e
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
import unittest
from aiokafka import AIOKafkaProducer, AIOKafkaConsumer
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
from osm_policy_module.core.config import Config
import uuid
from unittest.mock import patch, Mock
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
from osm_common.dbmongo import DbMongo
from playhouse.db_url import connect
os.remove("test_db.sqlite")
@patch.object(DbMongo, "db_connect", Mock())
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")
@patch.object(MonClient, "create_alarm")
@patch.object(CommonDbClient, "get_vnfd")
@patch.object(CommonDbClient, "get_nsr")
self.assertEqual(scaling_record.nsr_id, "test_nsr_id")
@patch.object(DbMongo, "db_connect", Mock())
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")
@patch.object(MonClient, "create_alarm")
@patch.object(CommonDbClient, "get_vnfd")
@patch.object(CommonDbClient, "get_nsr")
)
@patch.object(DbMongo, "db_connect", Mock())
)
@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")
@patch.object(MonClient, "create_alarm")
@patch.object(CommonDbClient, "get_vnfd")
@patch.object(CommonDbClient, "get_nsr")
deps = {[testenv]deps}
-r{toxinidir}/requirements-dev.txt
-r{toxinidir}/requirements-test.txt
deps = {[testenv]deps}
-r{toxinidir}/requirements-dev.txt
-r{toxinidir}/requirements-test.txt
commands =
pylint -E osm_policy_module
commands =
pylint -E osm_policy_module