-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from melexis/integration-test
Integration test start: JUnit
- Loading branch information
Showing
2 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from unittest import TestCase | ||
|
||
from mlx.warnings import warnings_wrapper | ||
|
||
|
||
class TestIntegration(TestCase): | ||
|
||
junit_warning_cnt = 3 | ||
|
||
def test_single_argument(self): | ||
retval = warnings_wrapper(['--junit', 'tests/junit_single_fail.xml']) | ||
self.assertEqual(1, retval) | ||
|
||
def test_two_arguments(self): | ||
retval = warnings_wrapper(['--junit', 'tests/junit_single_fail.xml', 'tests/junit_double_fail.xml']) | ||
self.assertEqual(1 + 2, retval) | ||
|
||
def test_wildcarded_arguments(self): | ||
# note: no shell expansion simulation (e.g. as in windows) | ||
retval = warnings_wrapper(['--junit', 'tests/junit*.xml']) | ||
self.assertEqual(self.junit_warning_cnt, retval) | ||
|
||
def test_max(self): | ||
retval = warnings_wrapper(['--junit', '--maxwarnings', '2', 'tests/junit*.xml']) | ||
self.assertEqual(self.junit_warning_cnt, retval) | ||
|
||
def test_max_but_still_ok(self): | ||
retval = warnings_wrapper(['--junit', '--maxwarnings', '100', 'tests/junit*.xml']) | ||
self.assertEqual(0, retval) | ||
|
||
def test_min(self): | ||
retval = warnings_wrapper(['--junit', '--maxwarnings', '100', '--minwarnings', '100', 'tests/junit*.xml']) | ||
self.assertEqual(self.junit_warning_cnt, retval) | ||
|
||
def test_min_but_still_ok(self): | ||
retval = warnings_wrapper(['--junit', '--maxwarnings', '100', '--minwarnings', '2', 'tests/junit*.xml']) | ||
self.assertEqual(0, retval) |