Пример #1
0
"""
# test_classifier_datasvc.py.py

"""
import logging
import os
import unittest
import numpy

from clsfr.utils.logger import get_logger

LOGGER = get_logger(__name__)


class DrDataSvcTests(unittest.TestCase):
    """
    DrDataSvcTests includes all unit tests for clsfr.classifier.datasvc module
    """
    @classmethod
    def teardown_class(cls):
        logging.shutdown()

    def setUp(self):
        """setup for test"""
        self.test_path = os.path.dirname(os.path.realpath(__file__))
        self.repo_path = os.path.dirname(self.test_path)
        self.proj_path = os.path.join(self.repo_path, "clsfr")
        self.base_path = os.path.join(self.repo_path, "clsfr", "classifier")
        self.data_path = os.path.join(self.repo_path, "clsfr", "classifier",
                                      "datasets")
        pass
Пример #2
0
import copy
import logging
import re
import threading
import time

from queue import Queue
from urllib.parse import urlparse

from clsfr.config import get_uint
from clsfr.common.api import get_api_data
from clsfr.utils.extension import get_attr
from clsfr.utils.logger import get_logger

DEBUG_LEVEL = get_uint('debug.level', logging.INFO)
LOGGER = get_logger(__name__, level=DEBUG_LEVEL)

LEVEL_LIMIT = get_uint('tasks.max_nested_level', 3)


class ServiceChecker:
    """
    ServiceChecker processes a list of endpoints.
    """
    def __init__(self, endpoints, max_level=LEVEL_LIMIT):
        """
        Constructor of clsfr.common.ServiceChecker

        @param endpoints: a list of endpoints with recursive multi-layer
                          routes that describes app and services.
        @param max_level: the maximum nested routes level.