Skip to content

Commit

Permalink
docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
JavierCladellas committed Dec 11, 2024
1 parent c28cb52 commit 5272e34
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/sanity/test_validationHandler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
""" Tests for the validationHandler class"""

import pytest
from feelpp.benchmarking.reframe.validation import ValidationHandler
from unittest.mock import patch
Expand Down Expand Up @@ -45,11 +47,17 @@ def generateErrorPatternTestCases():


class TestValidationHandler:
""" Tests the ValidationHandler class methods"""
#TODO: NOT ALL REGEX PATTERNS ARE SUPPORTED DUE TO ESCAPED CHARS,
# THIS SHOULD BE DESCRIBED IN AN ISSUE AND ADD RESPECTIVE UNIT TESTS WHEN IMPLEMENTED

@pytest.mark.parametrize("pattern, expected_result", generatSuccessPatternTestCases())
def test_checkSuccess(self,pattern,expected_result,sample_stdout,monkeypatch):
"""
Tests the check_success method of the ValudationHandler.
Checks that the pattern is found (or not) in the sample_stdout.
It compares what the function returns to a boolean symbolizing: True if the pattern is found, False if the pattern is NOT found
"""
validation_handler = ValidationHandler(MockSanityConfig(success=[pattern],error=[]))

monkeypatch.setattr(sn, 'assert_found', sn.assert_found_s)
Expand All @@ -63,6 +71,11 @@ def test_checkSuccess(self,pattern,expected_result,sample_stdout,monkeypatch):

@pytest.mark.parametrize("pattern, expected_result", generateErrorPatternTestCases())
def test_checkErrors(self,pattern,expected_result,sample_stdout,monkeypatch):
"""
Tests the check_errors method of the ValudationHandler
Checks that the pattern is found (or not) in the sample_stdout.
It compares what the function returns to a boolean symbolizing: True if the pattern is NOT found, False if the pattern is found
"""
validation_handler = ValidationHandler(MockSanityConfig(success=[],error=[pattern]))

monkeypatch.setattr(sn, 'assert_not_found', sn.assert_not_found_s)
Expand Down

0 comments on commit 5272e34

Please sign in to comment.