Ejemplo n.º 1
0
def client():
    """This fixture is flask client."""
    data_manager.DATA_MANAGER = MOCK_DATA_MANAGER

    packages = ["mindinsight.backend.optimizer"]

    mock_obj = Mock(return_value=packages)
    tools.find_app_package = mock_obj

    from mindinsight.backend.application import APP
    APP.response_class = Response
    app_client = APP.test_client()

    yield app_client
Ejemplo n.º 2
0
def client():
    """This fixture is flask client."""
    mock_data_manager = Mock()
    mock_data_manager.start_load_data = Mock()
    datavisual.DATA_MANAGER = mock_data_manager

    packages = ["mindinsight.backend.data_visual"]

    mock_obj = Mock(return_value=packages)
    tools.find_app_package = mock_obj

    from mindinsight.backend.application import APP
    APP.response_class = Response
    app_client = APP.test_client()

    yield app_client
Ejemplo n.º 3
0
def app_client():
    """This fixture is flask server."""
    packages = ["mindinsight.backend.debugger"]
    settings.ENABLE_DEBUGGER = True

    mock_obj = Mock(return_value=packages)
    tools.find_app_package = mock_obj

    from mindinsight.backend.application import APP
    APP.response_class = Response
    client = APP.test_client()
    original_val = settings.ENABLE_RECOMMENDED_WATCHPOINTS
    settings.ENABLE_RECOMMENDED_WATCHPOINTS = False
    try:
        yield client
    finally:
        settings.ENABLE_RECOMMENDED_WATCHPOINTS = original_val
    SessionManager.get_instance().exit()
Ejemplo n.º 4
0
def client():
    """This fixture is flask client."""

    gbl.mock_data_manager.start_load_data(reload_interval=0)
    check_loading_done(gbl.mock_data_manager)

    data_manager.DATA_MANAGER = gbl.mock_data_manager

    packages = ["mindinsight.backend.datavisual"]

    mock_obj = Mock(return_value=packages)
    tools.find_app_package = mock_obj

    from mindinsight.backend.application import APP
    APP.response_class = Response
    app_client = APP.test_client()

    yield app_client
Ejemplo n.º 5
0
def app_client():
    """This fixture is flask server."""
    packages = [
        "mindinsight.backend.debugger", "mindinsight.backend.conditionmgr"
    ]
    settings.ENABLE_DEBUGGER = True

    mock_obj = Mock(return_value=packages)
    tools.find_app_package = mock_obj

    from mindinsight.backend.application import APP
    from mindinsight.backend.debugger.debugger_api import BACKEND_SERVER
    APP.response_class = Response
    client = APP.test_client()
    original_val = settings.ENABLE_RECOMMENDED_WATCHPOINTS
    settings.ENABLE_RECOMMENDED_WATCHPOINTS = False
    try:
        yield client
    finally:
        settings.ENABLE_RECOMMENDED_WATCHPOINTS = original_val
    BACKEND_SERVER.stop()
Ejemplo n.º 6
0
def client():
    """This fixture is flask client."""
    APP.response_class = Response
    app_client = APP.test_client()

    yield app_client
Ejemplo n.º 7
0
 def setUp(self):
     """Test init."""
     APP.response_class = Response
     self.app_client = APP.test_client()
     self.url = '/v1/mindinsight/lineagemgr/lineages'
Ejemplo n.º 8
0
 def setup_method(self):
     """Test init."""
     APP.response_class = Response
     self._app_client = APP.test_client()
     self._url_op_queue = '/v1/mindinsight/profile/minddata-pipeline/op-queue'
     self._url_queue = '/v1/mindinsight/profile/minddata-pipeline/queue'
Ejemplo n.º 9
0
 def setUp(self):
     """Test init."""
     APP.response_class = Response
     self.app_client = APP.test_client()
     self.url = '/v1/mindinsight/profile/ops/search?train_id=run1&profile=profiler'