File: test_build_graph_serialize.py

package info (click to toggle)
python-azure 20250603%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 851,724 kB
  • sloc: python: 7,362,925; ansic: 804; javascript: 287; makefile: 195; sh: 145; xml: 109
file content (24 lines) | stat: -rw-r--r-- 1,517 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import pytest
from azure.media.videoanalyzeredge import *

class TestPipelineBuildSerialize():
    def test_build_pipeline_serialize(self):
        pipeline_topology_properties = PipelineTopologyProperties()
        pipeline_topology_name = 'pipelineTopologyTest'
        pipeline_topology_properties.description = "Continuous video recording to an Azure Media Services Asset"
        user_name_param = ParameterDeclaration(name="rtspUserName",type="String",default="testusername")
        password_param = ParameterDeclaration(name="rtspPassword",type="SecretString",default="testpassword")
        url_param = ParameterDeclaration(name="rtspUrl",type="String",default="rtsp://www.sample.com")
        hub_param = ParameterDeclaration(name="hubSinkOutputName",type="String")

        source = RtspSource(name="rtspSource", endpoint=UnsecuredEndpoint(url="${rtspUrl}",credentials=UsernamePasswordCredentials(username="${rtspUserName}",password="${rtspPassword}")))
        node = NodeInput(node_name="rtspSource")
        pipeline_topology_properties.parameters = [user_name_param, password_param, url_param, hub_param]
        pipeline_topology_properties.sources = [source]
        pipeline_topology = PipelineTopology(name=pipeline_topology_name,properties=pipeline_topology_properties)



        set_top_method = PipelineTopologySetRequest(pipeline_topology=pipeline_topology)
        set_top_method_serialize = set_top_method.serialize()
        assert set_top_method_serialize['name'] == pipeline_topology_name