diff --git a/.github/workflows/ufm_log_analyzer_ci_workflow.yml b/.github/workflows/ufm_log_analyzer_ci_workflow.yml index 8d5015c0..543ef8ef 100644 --- a/.github/workflows/ufm_log_analyzer_ci_workflow.yml +++ b/.github/workflows/ufm_log_analyzer_ci_workflow.yml @@ -78,4 +78,4 @@ jobs: pip install -r src/loganalyze/requirements.txt pip install pytest - pytest \ No newline at end of file + pytest /unit_tests \ No newline at end of file diff --git a/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc b/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc index 1f8ebad5..fe4d56ae 100644 --- a/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc +++ b/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc @@ -8,4 +8,7 @@ disable=missing-function-docstring, [DESIGN] max-locals=20 -max-args=8 \ No newline at end of file +max-args=8 + +[unit_tests/*] +disable=protected-access \ No newline at end of file diff --git a/plugins/ufm_log_analyzer_plugin/unit_tests/test_ibdiagnet_log_analyzer.py b/plugins/ufm_log_analyzer_plugin/unit_tests/test_ibdiagnet_log_analyzer.py index 026f7447..bc157d26 100644 --- a/plugins/ufm_log_analyzer_plugin/unit_tests/test_ibdiagnet_log_analyzer.py +++ b/plugins/ufm_log_analyzer_plugin/unit_tests/test_ibdiagnet_log_analyzer.py @@ -34,8 +34,8 @@ def analyzer(): def test_get_fabric_size(analyzer): # Mock the _log_data_sorted attribute expected_fabric_size = {"switch_count": 10, "link_count": 50} # Example data - analyzer._log_data_sorted = expected_fabric_size # pylint: disable=protected-access + analyzer._log_data_sorted = expected_fabric_size # Call the method and check the result result = analyzer.get_fabric_size() - assert result == expected_fabric_size \ No newline at end of file + assert result == expected_fabric_size, "get_fabric_size should return _log_data_sorted" \ No newline at end of file diff --git a/plugins/ufm_log_analyzer_plugin/unit_tests/test_ufm_top_analyzer.py b/plugins/ufm_log_analyzer_plugin/unit_tests/test_ufm_top_analyzer.py index 6cebb7cb..0a589a7e 100644 --- a/plugins/ufm_log_analyzer_plugin/unit_tests/test_ufm_top_analyzer.py +++ b/plugins/ufm_log_analyzer_plugin/unit_tests/test_ufm_top_analyzer.py @@ -32,14 +32,14 @@ def test_add_analyzer(analyzer): mock_analyzer_2 = "Analyzer2" # Initially, the list should be empty - assert len(analyzer._analyzers) == 0 # pylint: disable=protected-access + assert len(analyzer._analyzers) == 0 # Add first analyzer and check the length analyzer.add_analyzer(mock_analyzer_1) - assert len(analyzer._analyzers) == 1 # pylint: disable=protected-access - assert mock_analyzer_1 in analyzer._analyzers # pylint: disable=protected-access + assert len(analyzer._analyzers) == 1 + assert mock_analyzer_1 in analyzer._analyzers # Add second analyzer and check the updated length analyzer.add_analyzer(mock_analyzer_2) - assert len(analyzer._analyzers) == 2 # pylint: disable=protected-access - assert mock_analyzer_2 in analyzer._analyzers # pylint: disable=protected-access + assert len(analyzer._analyzers) == 2 + assert mock_analyzer_2 in analyzer._analyzers