Skip to content

Commit

Permalink
[tests] test utils.expected_failure_if decorator
Browse files Browse the repository at this point in the history
Change-Id: Ica11663eed755878ce997b70e63867c861859eb8
  • Loading branch information
xqt committed Oct 19, 2024
1 parent dfaf905 commit 9ad9709
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/tests_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ def test_entered_loop(self):
self.assertTrue(utils.entered_loop(self.pattern))
self.assertFalse(utils.entered_loop(''))

@utils.expected_failure_if(True)
def test_expected_failure_true(self):
"""Test expected_failure_if decorator if condition is True."""
self.assertTrue(False)

@utils.expected_failure_if(False)
def test_expected_failure_false(self):
"""Test expected_failure_if decorator if condition is False."""
self.assertTrue(True)


if __name__ == '__main__':
with suppress(SystemExit):
Expand Down

0 comments on commit 9ad9709

Please sign in to comment.