def test_failed_pattern_no_buildtool_match(self): """ Test failed_pattern with buildtool unset and match in failed_commands """ build.failed_pattern('line to test for failure: lex', r'(lex)', 0) self.assertIn('flex', build.buildreq.buildreqs) self.assertEqual(build.must_restart, 1)
def test_failed_pattern_no_match(self): """ Test failed_pattern with no match """ build.failed_pattern('line to test for failure: somepkg', r'(test)', 0) self.assertEqual(build.buildreq.buildreqs, set()) self.assertEqual(build.must_restart, 0)
def test_failed_pattern_no_buildtool(self): """ Test failed_pattern with buildtool unset and initial match, but no match in failed_commands. """ build.failed_pattern('line to test for failure: testpkg', r'(test)', 0) self.assertEqual(build.buildreq.buildreqs, set()) self.assertEqual(build.must_restart, 0)
def test_failed_pattern_no_match(self): """ Test failed_pattern with no match """ conf = config.Config() reqs = buildreq.Requirements("") build.failed_pattern('line to test for failure: somepkg', conf, reqs, r'(test)', 0) self.assertEqual(reqs.buildreqs, set()) self.assertEqual(build.must_restart, 0)
def test_failed_pattern_perl(self): """ Test failed_pattern with buildtool set to perl """ build.failed_pattern( 'line to test for failure: testpkg.pl', r'(testpkg)', 0, # verbose=0 buildtool='perl') self.assertIn('perl(testpkg)', build.buildreq.buildreqs) self.assertEqual(build.must_restart, 1)
def test_failed_pattern_no_buildtool(self): """ Test failed_pattern with buildtool unset and initial match, but no match in failed_commands. """ conf = config.Config() reqs = buildreq.Requirements("") build.failed_pattern('line to test for failure: testpkg', conf, reqs, r'(test)', 0) self.assertEqual(reqs.buildreqs, set()) self.assertEqual(build.must_restart, 0)
def test_failed_pattern_no_buildtool_match(self): """ Test failed_pattern with buildtool unset and match in failed_commands """ conf = config.Config() reqs = buildreq.Requirements("") conf.setup_patterns() build.failed_pattern('line to test for failure: lex', conf, reqs, r'(lex)', 0) self.assertIn('flex', reqs.buildreqs) self.assertEqual(build.must_restart, 1)
def test_failed_pattern_pypi(self): """ Test failed_pattern with buildtool set to pypi """ build.failed_pattern( 'line to test for failure: testpkg.py', r'(testpkg)', 0, # verbose=0 buildtool='pypi') self.assertIn('testpkg-python', build.buildreq.buildreqs) self.assertEqual(build.must_restart, 1)
def test_failed_pattern_maven(self): """ Test failed_pattern with buildtool set to maven, but no match in config.maven_jars, it should just prepend 'mvn-' to the package name. """ build.failed_pattern( 'line to test for failure: testpkg', r'(testpkg)', 0, # verbose=0 buildtool='maven') self.assertIn('mvn-testpkg', build.buildreq.buildreqs) self.assertEqual(build.must_restart, 1)
def test_failed_pattern_ruby_table_no_match(self): """ Test failed_pattern with buildtool set to ruby table but no match in config.gems. This should not modify anything. """ build.failed_pattern( 'line to test for failure: testpkg', r'(testpkg)', 0, # verbose=0 buildtool='ruby table') self.assertEqual(build.buildreq.buildreqs, set()) self.assertEqual(build.must_restart, 0)
def test_failed_pattern_ruby_table(self): """ Test failed_pattern with buildtool set to ruby table and a match in config.gems """ build.failed_pattern( 'line to test for failure: test/unit', r'(test/unit)', 0, # verbose=0 buildtool='ruby table') self.assertIn('rubygem-test-unit', build.buildreq.buildreqs) self.assertEqual(build.must_restart, 1)
def test_failed_pattern_ruby(self): """ Test failed_pattern with buildtool set to ruby, but no match in config.gems, it should just prepend 'rubygem-' to the package name. """ build.failed_pattern( 'line to test for failure: testpkg.rb', r'(testpkg)', 0, # verbose=0 buildtool='ruby') self.assertIn('rubygem-testpkg', build.buildreq.buildreqs) self.assertEqual(build.must_restart, 1)
def test_failed_pattern_R(self): """ Test failed_pattern with buildtool set to R """ build.failed_pattern( 'line to test for failure: testpkg.r', r'(testpkg)', 0, # verbose=0 buildtool='R') self.assertIn('R-testpkg', build.buildreq.buildreqs) self.assertIn('R-testpkg', build.buildreq.requires) self.assertEqual(build.must_restart, 1)
def test_failed_pattern_pkgconfig(self): """ Test failed_pattern with buildtool set to pkgconfig """ build.buildreq.config.config_opts['32bit'] = False build.failed_pattern( 'line to test for failure: testpkg.xyz', r'(testpkg)', 0, # verbose=0 buildtool='pkgconfig') self.assertIn('pkgconfig(testpkg)', build.buildreq.buildreqs) self.assertEqual(build.must_restart, 1)
def test_failed_pattern_maven_match(self): """ Test failed_pattern with buildtool set to maven with a match in config.maven_jars. In the particular case of aether, the corresponding maven jar is 'mvn-aether-core' """ build.failed_pattern( 'line to test for failure: aether', r'(aether)', 0, # verbose=0 buildtool='maven') self.assertIn('mvn-aether-core', build.buildreq.buildreqs) self.assertEqual(build.must_restart, 1)
def test_failed_pattern_ruby_gem_match(self): """ Test failed_pattern with buildtool set to ruby and a match in config.gems. In the particular case of test/unit, the result should be rubygem-test-unit. """ build.failed_pattern( 'line to test for failure: test/unit', r'(test/unit)', 0, # verbose=0 buildtool='ruby') self.assertIn('rubygem-test-unit', build.buildreq.buildreqs) self.assertEqual(build.must_restart, 1)
def test_failed_pattern_pypi(self): """ Test failed_pattern with buildtool set to pypi """ conf = config.Config() reqs = buildreq.Requirements("") build.failed_pattern( 'line to test for failure: testpkg.py', conf, reqs, r'(testpkg)', 0, # verbose=0 buildtool='pypi') self.assertIn('testpkg-python', reqs.buildreqs) self.assertEqual(build.must_restart, 1)
def test_failed_pattern_R(self): """ Test failed_pattern with buildtool set to R """ conf = config.Config() conf.setup_patterns() reqs = buildreq.Requirements("") build.failed_pattern( 'line to test for failure: testpkg.r', conf, reqs, r'(testpkg)', 0, # verbose=0 buildtool='R') self.assertIn('R-testpkg', reqs.buildreqs) self.assertIn('R-testpkg', reqs.requires) self.assertEqual(build.must_restart, 1)
def test_failed_pattern_ruby_table(self): """ Test failed_pattern with buildtool set to ruby table and a match in config.gems """ conf = config.Config() conf.setup_patterns() reqs = buildreq.Requirements("") build.failed_pattern( 'line to test for failure: test/unit', conf, reqs, r'(test/unit)', 0, # verbose=0 buildtool='ruby table') self.assertIn('rubygem-test-unit', reqs.buildreqs) self.assertEqual(build.must_restart, 1)
def test_failed_pattern_ruby_gem_match(self): """ Test failed_pattern with buildtool set to ruby and a match in config.gems. In the particular case of test/unit, the result should be rubygem-test-unit. """ conf = config.Config() conf.setup_patterns() reqs = buildreq.Requirements("") build.failed_pattern( 'line to test for failure: test/unit', conf, reqs, r'(test/unit)', 0, # verbose=0 buildtool='ruby') self.assertIn('rubygem-test-unit', reqs.buildreqs) self.assertEqual(build.must_restart, 1)