From e65261f370b60a6a1f321310437febbfce2727ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20A=C5=9F=C4=B1c=C4=B1?= Date: Sun, 11 Jul 2010 09:03:54 +0000 Subject: [PATCH] tests: Fix shelltest It seems the execution order can change. We should break the dependencies between tests. --- tests/shelltest.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/shelltest.py b/tests/shelltest.py index 9d05fd0a..aae2a520 100644 --- a/tests/shelltest.py +++ b/tests/shelltest.py @@ -42,7 +42,7 @@ class ShellTestCase(unittest.TestCase): def testSym(self): from pisi.actionsapi.shelltools import sym - sym('scenarios/repo','tests/repos') + sym('../../scenarios/repo','tests/repos') self.assertEqual(os.path.islink('tools'),False) self.assertEqual(os.path.islink('tests/repos'),True) @@ -52,36 +52,38 @@ class ShellTestCase(unittest.TestCase): from pisi.actionsapi.shelltools import unlinkDir makedirs('tests/testdirectory/sample') - sym('tests/testdirectory/sample','tests/history') - self.assertEqual(os.path.islink('tests/history'),True) + sym('testdirectory/sample', 'tests/history') + self.assertEqual(os.path.islink('tests/history'), True) unlinkDir('tests/testdirectory/sample') - self.assertEqual(os.path.islink('tests/testdirectory/sample'),False) + self.assertEqual(os.path.islink('tests/testdirectory/sample'), False) def testCopy(self): from pisi.actionsapi.shelltools import echo from pisi.actionsapi.shelltools import copy + from pisi.actionsapi.shelltools import makedirs - copy('./tests', './tests-copy') - self.assertEqual(os.path.islink('./tests-copy'),False) + makedirs('tests/testdirectory/sample') + copy('tests', 'tests-copy') + self.assertEqual(os.path.islink('tests-copy'), False) shutil.rmtree("tests-copy") echo('tests/echo-file', 'subject eco') - copy('./tests/echo-file', './tests/echo-file-copy') - self.assertEqual(os.path.islink('./tests/echo-file-copy'), False) + copy('tests/echo-file', 'tests/echo-file-copy') + self.assertEqual(os.path.islink('tests/echo-file-copy'), False) os.remove("tests/echo-file") def testIsLink(self): from pisi.actionsapi.shelltools import sym from pisi.actionsapi.shelltools import isLink - sym('tests/database','tests/history') + sym('../database', 'tests/history') assert isLink('tests/history') assert not isLink('tests/runtests.py') def testIsFile(self): from pisi.actionsapi.shelltools import isFile - assert isFile('/usr/lib/engines/libaep.so') + assert isFile('/bin/bash') assert not isFile('/tests/database') def testIsDirectory(self):