Skip to content

Commit

Permalink
First simple pytest test
Browse files Browse the repository at this point in the history
  • Loading branch information
vg12345 committed May 15, 2024
1 parent ee3564a commit 9451c9b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/pdr_plugin_ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,10 @@ jobs:
run: |
pip install -r plugins/pdr_deterministic_plugin/requirements.txt
pip install pylint
pip install pytest pytest-cov
- name: Run PyLint
run: pylint --rcfile=plugins/pdr_deterministic_plugin/.pylintrc plugins/pdr_deterministic_plugin
run: pylint --rcfile=plugins/pdr_deterministic_plugin/.pylintrc plugins/pdr_deterministic_plugin

- name: Test exclude list with pytest
run: pytest exclude_list_tests.py --doctest-modules --junitxml=junit/exclude_list_tests_results.xml --cov=com --cov-report=xml --cov-report=html
26 changes: 26 additions & 0 deletions plugins/pdr_deterministic_plugin/tests/exclude_list_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Copyright © 2013-2024 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
#
# This software product is a proprietary product of Nvidia Corporation and its affiliates
# (the "Company") and all right, title, and interest in and to the software
# product, including all associated intellectual property rights, are and
# shall remain exclusively with the Company.
#
# This software product is governed by the End User License Agreement
# provided with the software product.
#

#import pytest
from plugins.pdr_deterministic_plugin.ufm_sim_web_service.constants import PDRConstants as Constants
from plugins.pdr_deterministic_plugin.ufm_sim_web_service.exclude_list import ExcludeList
from plugins.pdr_deterministic_plugin.ufm_sim_web_service.isolation_algo import create_logger

def test_get_from_empty_list():
"""
Create exclude list and ensure its empty via its method
"""

logger = create_logger(Constants.LOG_FILE)
exclude_list = ExcludeList(logger)
items = exclude_list.items()
assert not items

0 comments on commit 9451c9b

Please sign in to comment.