Commit a4f5eca6 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Tests:

- Removed generic src/tests/Fixtures.py
- Propagated as needed the fixtures to per-test Fixtures.py files
parent 05f3775e
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
# Copyright 2022-2026 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import pytest
from context.client.ContextClient import ContextClient
from device.client.DeviceClient import DeviceClient


@pytest.fixture(scope='session')
def context_client():
    _client = ContextClient()
    yield _client
    _client.close()


@pytest.fixture(scope='session')
def device_client():
    _client = DeviceClient()
    yield _client
    _client.close()
+13 −0
Original line number Diff line number Diff line
# Copyright 2022-2026 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+13 −5
Original line number Diff line number Diff line
@@ -12,14 +12,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import logging, os, time, json, socket, re
import json, logging, os, re, socket, time

from common.Constants import DEFAULT_CONTEXT_NAME
from common.proto.context_pb2 import ContextId, DeviceOperationalStatusEnum, Empty
from common.tools.descriptor.Loader import DescriptorLoader, check_descriptor_load_results, validate_empty_scenario
from common.proto.context_pb2 import (
    ContextId, DeviceOperationalStatusEnum, Empty,
)
from common.tools.descriptor.Loader import (
    DescriptorLoader, check_descriptor_load_results, validate_empty_scenario,
)
from common.tools.object_factory.Context import json_context_id
from context.client.ContextClient import ContextClient
from device.client.DeviceClient import DeviceClient
from tests.Fixtures import context_client, device_client # pylint: disable=unused-import

from .Fixtures import (
    context_client, device_client,
)  # pylint: disable=unused-import

LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.DEBUG)
+8 −2
Original line number Diff line number Diff line
@@ -13,13 +13,19 @@
# limitations under the License.

import logging, os

from common.Constants import DEFAULT_CONTEXT_NAME
from common.proto.context_pb2 import ContextId
from common.tools.descriptor.Loader import DescriptorLoader, validate_empty_scenario
from common.tools.descriptor.Loader import (
    DescriptorLoader, validate_empty_scenario,
)
from common.tools.object_factory.Context import json_context_id
from context.client.ContextClient import ContextClient
from device.client.DeviceClient import DeviceClient
from .Fixtures import context_client, device_client    # pylint: disable=unused-import

from .Fixtures import (
    context_client, device_client,
)  # pylint: disable=unused-import

LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.DEBUG)
+11 −3
Original line number Diff line number Diff line
@@ -13,13 +13,21 @@
# limitations under the License.

import logging, os, time

from common.Constants import DEFAULT_CONTEXT_NAME
from common.proto.context_pb2 import ContextId, DeviceOperationalStatusEnum, Empty
from common.tools.descriptor.Loader import DescriptorLoader, check_descriptor_load_results, validate_empty_scenario
from common.proto.context_pb2 import (
    ContextId, DeviceOperationalStatusEnum, Empty,
)
from common.tools.descriptor.Loader import (
    DescriptorLoader, check_descriptor_load_results, validate_empty_scenario,
)
from common.tools.object_factory.Context import json_context_id
from context.client.ContextClient import ContextClient
from device.client.DeviceClient import DeviceClient
from .Fixtures import context_client, device_client # pylint: disable=unused-import

from .Fixtures import (
    context_client, device_client,
)  # pylint: disable=unused-import

LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.DEBUG)
Loading