--- a/test/unittest_task.py Wed Aug 07 12:41:59 2013 +0200
+++ b/test/unittest_task.py Wed Aug 07 12:42:44 2013 +0200
@@ -163,179 +163,6 @@
class TestTC(TestCase):
- @within_tempdir
- def test_setup_installed(self):
- self.skipTest('to be done by pyves')
- pp = SimplePreprocessor()
- test = Test(TestConfig('yo', dependencies=(Environment('pypasax'),)),
- MockTestWriter(),
- checkers=[SuccessTestChecker()],
- preprocessors={'install': pp})
- test._repositories['pypasax'] = SVNREPO2
- test.setup()
- self.assertEqual(pp.processed, {'soft/goodpkg': 1, 'badpkg2': 1})
-
-
- def test_setup_no_install(self):
- self.skipTest('to be done by pyves')
- test = Test(TestConfig('yo', dependencies=(Environment('pypasax'),)),
- MockTestWriter(),
- preprocessors={'install': TPP})
- test._repositories['pypasax'] = SVNREPO2
- # no checks requiring installation, main repo should be checked out though not installed,
- # and dependencies shouldn't be installed
- try:
- test.setup()
- self.assertEqual(os.environ['ZIGUOUIGOUI'], 'YOOOO')
- self.failUnless(exists('goodpkg'))
- self.failIf(exists('badpkg2'))
- self.failUnless(TPP.file is None or not exists(TPP.file))
- finally:
- os.environ.pop('ZIGUOUIGOUI', None)
- if exists('goodpkg'):
- shutil.rmtree('goodpkg')
-
- def test_python_setup(self):
- self.skipTest('to be done by pyves')
- test = Test(TestConfig('yo', dependencies=(Environment('pypasax'),)),
- MockTestWriter(),
- checkers=[SuccessTestChecker()],
- preprocessors={'install': TPP})
- test._repositories['pypasax'] = SVNREPO2
- try:
- test.setup()
- tconfig = test.tconfig
- projectenvs = (tconfig.environment,) + tconfig.dependencies()
- for pe in projectenvs:
- test.checkout(pe)
- self.assertEqual(os.environ['ZIGUOUIGOUI'], 'YOOOO')
- self.failUnless(exists('goodpkg'))
- self.failUnless(exists('badpkg2'))
- self.failUnless(exists(TPP.file))
- finally:
- if exists('goodpkg'):
- shutil.rmtree('goodpkg')
- if exists('badpkg2'):
- shutil.rmtree('badpkg2')
- if TPP.file is not None and exists(TPP.file):
- os.remove(TPP.file)
- if TPP.file2 is not None and exists(TPP.file2):
- os.remove(TPP.file2)
- del os.environ['ZIGUOUIGOUI']
-
- @within_tempdir
- def _test_setup_ex(self, test, msg=None):
- self.skipTest('to be done by pyves')
- try:
- test.setup()
- self.failUnless(test._failed_pp, 'Preprocessors should have failed')
- except SetupException, ex:
- if msg:
- self.assertEqual(str(ex), msg)
-
- def test_setup_raise(self):
- self.skipTest('to be done by pyves')
- # test bad checkout command
- test = Test(TestConfig('yo'), MockTestWriter(), repo=BADREPO)
- self._test_setup_ex(test, "`false` returned with status : 1")
- # test bad dependencies checkout
- test = Test(TestConfig('yo', dependencies=(Environment('toto'),),
- ),
- MockTestWriter(),
- checkers=[SuccessTestChecker()])
- test._repositories['toto'] = BADREPO
- self._test_setup_ex(test)
- # test bad preprocessing
- test = Test(TestConfig('yo', dependencies=(Environment('pypasax'),),
- ),
- MockTestWriter(),
- checkers=[SuccessTestChecker()],
- preprocessors={'install': SetupRaisePreprocessor()})
- test._repositories['pypasax'] = SVNREPO2
- self._test_setup_ex(test)
-
- def test_clean(self):
- self.skipTest("We don't execute whole test anymore")
- test = Test(TestConfig('yo', dependencies=(Environment('pypasax'),),
- ),
- MockTestWriter(),
- checkers=[SuccessTestChecker()],
- preprocessors={'install': TPP})
- test._repositories['pypasax'] = SVNREPO2
- # clean should never fail
- # but most interesting things occurs after setup...
- test.execute()
- self.assertNotNone(TPP.file, "Preprocessors have not been run")
- self.failIf(exists('goodpkg'))
- self.failIf(exists('badpkg2'))
- self.failIf(exists(TPP.file))
-
- def test_execute_1(self):
- self.skipTest("We don't execute whole test anymore")
- test = Test(TestConfig('yo', dependencies=(Environment('Pypasax'),),
- ),
- MockTestWriter(), repo=SVNREPO1,
- checkers=[SuccessTestChecker(), FailureTestChecker(), ErrorTestChecker()],
- preprocessors={'install': TPP})
- test._repositories['Pypasax'] = SVNREPO2
- test.execute()
- self.assertNotNone(TPP.file)
- self.failIf(exists(TPP.file))
- self.assertNotNone(TPP.file2)
- self.failIf(exists(TPP.file2))
-
- def test_execute_2(self):
- self.skipTest("We don't execute whole test anymore")
- test = Test(TestConfig('yo', dependencies=(Environment('Pypasax', SVNREPO2),),
- ),
- MockTestWriter(), repo=SVNREPO1,
- checkers=[SuccessTestChecker(), FailureTestChecker(), ErrorTestChecker()],
- preprocessors={'install:': SetupRaisePreprocessor()})
- test._repositories['Pypasax'] = SVNREPO2
- test.execute()
-
- def test_execute_0(self):
- self.skipTest("We don't execute whole test anymore")
- command = 'cp -R '+abspath('inputs/goodpkg')+' .'
- cwd = os.getcwd()
- test = Test(TestConfig('yo', dependencies=(Environment('Pypasax'),)),
- MockTestWriter())
- test._repositories['Pypasax'] = SVNREPO2
- self.failUnless(exists(test.tmpdir))
- test.execute()
- self.failIf(exists(test.tmpdir))
- self.assertEqual(os.getcwd(), cwd)
-
- test = Test(TestConfig('yo', dependencies=(Environment('Pypasax'),)),
- MockTestWriter(), {'keep-test-dir':1},)
- test._repositories['Pypasax'] = SVNREPO2
- self.failUnless(exists(test.tmpdir))
- test.execute()
- self.failIf(exists(test.tmpdir))
- self.assertEqual(os.getcwd(), cwd)
-
- test = Test(TestConfig('yo', dependencies=(Environment('Pypasax'),),
- ),
- MockTestWriter()(), repo=SVNREPO1,
- checkers=[SuccessTestChecker()],
- preprocessors={'install': SetupRaisePreprocessor()})
- test._repositories['Pypasax'] = SVNREPO2
- self.failUnless(exists(test.tmpdir))
- test.execute()
- self.failIf(exists(test.tmpdir))
- self.assertEqual(os.getcwd(), cwd)
-
- test = Test(TestConfig('yo', dependencies=(Environment('Pypasax'),),
- ),
- MockTestWriter()(), repo=SVNREPO1,
- checkers=[SuccessTestChecker()],
- preprocessors={'install': CleanRaisePreprocessor()})
- test._repositories['Pypasax'] = SVNREPO2
- self.failUnless(exists(test.tmpdir))
- test.execute()
- self.failIf(exists(test.tmpdir))
- self.assertEqual(os.getcwd(), cwd)
-
def test_branch(self):
test = Test(TestConfig('yo'),
MockTestWriter(),