コード例 #1
0
    def test_get_loaded_pipelines_empty(self):
        
        PipelineManager.pipelines = None

        expected_result = []
        result = PipelineManager.get_loaded_pipelines()
                
        self.assertEqual(result, expected_result)
コード例 #2
0
def pipelines_get():  # noqa: E501
    """pipelines_get

    Return supported pipelines # noqa: E501


    :rtype: List[Pipeline]
    """

    logger.debug("GET on /pipelines")
    return PipelineManager.get_loaded_pipelines()
コード例 #3
0
def pipelines_get():  # noqa: E501
    """pipelines_get

    Return supported pipelines # noqa: E501


    :rtype: List[Pipeline]
    """
    try:
        logger.debug("GET on /pipelines")
        return PipelineManager.get_loaded_pipelines()
    except Exception as e:
        logger.error('pipelines_name_version_get '+e)
        return ('Unexpected error', HTTPStatus.INTERNAL_SERVER_ERROR)
コード例 #4
0
    def test_get_loaded_pipelines_populated(self):

        PipelineManager.pipelines = {
            "object_detection": {
                1: {
                    "name": "object_detection",
                    "version": 1,
                    "type": "GStreamer",
                    "template": "",
                    "description": "Object Detection Pipeline",
                    "parameters": {
                        "send-empty": {
                            "element":"jsonmetaconvert"
                        },
                        "every-nth-frame": {
                            "element":"detection"
                        }
                    }
                }
            }
        }

        expected_result = [{
            "name": "object_detection",
            "version": 1,
            "type": "GStreamer",
            "description": "Object Detection Pipeline",
            "parameters": {
                "send-empty": {
                    "element":"jsonmetaconvert"
                },
                "every-nth-frame": {
                    "element":"detection"
                }
            }
        }]
        result = PipelineManager.get_loaded_pipelines()

        self.assertEqual(result, expected_result)