commit/galaxy-central: jmchilton: More stdio handling tests.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/df18a38465c2/ Changeset: df18a38465c2 User: jmchilton Date: 2014-05-21 18:11:39 Summary: More stdio handling tests. Affected #: 1 file diff -r d0979f737213cbc8e000a46f90a7cd5501c709d1 -r df18a38465c2cd7d7e8014febc3d955758f84671 test/unit/jobs/test_job_output_checker.py --- a/test/unit/jobs/test_job_output_checker.py +++ b/test/unit/jobs/test_job_output_checker.py @@ -2,6 +2,7 @@ from galaxy.util.bunch import Bunch from galaxy.jobs.output_checker import check_output from galaxy.jobs.error_level import StdioErrorLevel +from galaxy.tools import ToolStdioRegex class OutputCheckerTestCase( TestCase ): @@ -39,19 +40,53 @@ self.tool_exit_code = 0 self.__assertSuccessful() - def test_problematic_strings( self ): + def test_problematic_strings_matching( self ): problematic_str = '\x80abc' - regex_rule = Bunch( match=r'.abc', stdout_match=False, stderr_match=True, error_level=StdioErrorLevel.FATAL, desc=None ) - self.tool.stdio_regexes = [ regex_rule ] + self.__add_regex( Bunch( match=r'.abc', stdout_match=False, stderr_match=True, error_level=StdioErrorLevel.FATAL, desc=None ) ) self.stderr = problematic_str self.__assertNotSuccessful() + def test_problematic_strings_not_matching( self ): problematic_str = '\x80abc' - regex_rule = Bunch( match=r'.abcd', stdout_match=False, stderr_match=True, error_level=StdioErrorLevel.FATAL, desc=None ) - self.tool.stdio_regexes = [ regex_rule ] + self.__add_regex( Bunch( match=r'.abcd', stdout_match=False, stderr_match=True, error_level=StdioErrorLevel.FATAL, desc=None ) ) self.stderr = problematic_str self.__assertSuccessful() + def test_stderr_regex_negative_match( self ): + regex = ToolStdioRegex() + regex.stderr_match = True + regex.match = "foobar" + self.__add_regex( regex ) + self.stderr = "foo" + self.__assertSuccessful() + + def test_stderr_regex_positive_match( self ): + regex = ToolStdioRegex() + regex.stderr_match = True + regex.match = "foo" + self.__add_regex( regex ) + self.stderr = "foobar" + self.__assertNotSuccessful() + + def test_stdout_ignored_for_stderr_regexes( self ): + regex = ToolStdioRegex() + regex.stderr_match = True + regex.match = "foo" + self.__add_regex( regex ) + self.stdout = "foobar" + self.__assertSuccessful() + + def test_stderr_ignored_for_stdout_regexes( self ): + regex = ToolStdioRegex() + regex.stdout_match = True + regex.match = "foo" + self.__add_regex( regex ) + self.stderr = "foobar" + self.__assertSuccessful() + + def __add_regex( self, regex ): + self.tool.stdio_regexes.append( regex ) + def __assertSuccessful( self ): self.assertTrue( self.__check_output() ) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org