Skip to content
Snippets Groups Projects
Commit a045f9fe authored by Carlos Natalino Da Silva's avatar Carlos Natalino Da Silva
Browse files

Improving tests.

parent dc22fc8f
No related branches found
No related tags found
2 merge requests!142Release TeraFlowSDN 2.1,!138Fixing the tests of the optical cybersecurity components
......@@ -31,7 +31,6 @@ from opticalattackdetector.service.OpticalAttackDetectorService import \
# from .example_objects import CONTEXT_ID, CONTEXT_ID_2, SERVICE_DEV1_DEV2
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.DEBUG)
@pytest.fixture(scope="session")
......
......@@ -13,26 +13,27 @@
# limitations under the License.
import logging
import os
from unittest.mock import patch
import uuid
import pytest
from opticalattackmanager.utils.monitor import delegate_services
from common.Constants import (DEFAULT_GRPC_GRACE_PERIOD,
DEFAULT_GRPC_MAX_WORKERS,
DEFAULT_SERVICE_GRPC_PORTS, ServiceNameEnum)
from common.proto import dbscanserving_pb2 as dbscan
from common.proto.optical_attack_detector_pb2 import DetectionRequest
from opticalattackdetector.client.OpticalAttackDetectorClient import \
OpticalAttackDetectorClient
from opticalattackdetector.service.OpticalAttackDetectorService import \
OpticalAttackDetectorService
# from .example_objects import CONTEXT_ID, CONTEXT_ID_2, SERVICE_DEV1_DEV2
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.DEBUG)
def test_detect_attack():
LOGGER.info("placeholder")
def test_delegate_services():
service_list = [
{
"context": uuid.uuid4(),
"service": uuid.uuid4(),
"kpi": 10,
}
for _ in range(10)]
delegate_services(
service_list=service_list,
start_index=0,
end_index=9,
host="127.0.0.1",
port="10006",
monitoring_interval=10,
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment