SPDX-FileCopyrightText: Copyright (c) 2018-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. SPDX-License-Identifier: Apache-2.0
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.
Testing deepstream python bindings working in a pipeline.
cd tests/integration
pytest test.py
- Since full pipelines are tested, testing takes more time than direct function call
- Video output of pipeline should be set to fakesink to allow efficient automated testing
Installing:
- python virtual env for the requested python version
- dependencies listed in the
bindingsfolder - pytest
mkdir -p bindings/build
cd bindings/build
cmake .. -DPYTHON_MINOR_VERSION=6
make
python3.6 -m venv env
cmake .. -DPYTHON_MINOR_VERSION=8
make
python3.8 -m venv env
. env/bin/activate
pip install pyds-1.1.3-py3-none-*.whl
pip install pytest
cd ../../tests/integration
pytest test.py
In order to add more test let's have a quick overview of the architecture
- Generic pipeline This abstract class handles the common pipeline behavior required to process pipeline elements.
- Simple pipeline no output This pipeline processes 1 video stream and 1 probe and its output is hidden. It is derived from Generic Pipeline, so that only the pipeline element creation and linking is performed
From the above derived pipelines you can make your own by modifying and linking the new elements.
You can copy an existing test from tests/bindings/test.py and modify it.
Tests are written in 3 parts:
- Data initialization
- Executing behavior
- Checking results