diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2010-10-06 12:23:41 +0200 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-10-06 12:23:41 +0200 |
commit | c0a03683c8e031d4958ba48b3e0e8724c117e803 (patch) | |
tree | fea2de463a8c42b35690c55d640ebf28bd680bba | |
parent | abcaf0904b27bc0603f3fd011901784b14a7cd4d (diff) | |
download | logilab-common-c0a03683c8e031d4958ba48b3e0e8724c117e803.tar.gz |
fix tests: should be runnable as script from anywhere
-rw-r--r-- | test/unittest_fileutils.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/unittest_fileutils.py b/test/unittest_fileutils.py index d900b3f..b76196f 100644 --- a/test/unittest_fileutils.py +++ b/test/unittest_fileutils.py @@ -25,7 +25,7 @@ from logilab.common.testlib import TestCase, unittest_main, unittest from logilab.common.fileutils import * -DATA_DIR = 'data' +DATA_DIR = join(os.path.abspath(os.path.dirname(__file__)), 'data') NEWLINES_TXT = join(DATA_DIR,'newlines.txt') @@ -72,7 +72,7 @@ class ExportTC(TestCase): os.mkdir(self.tempdir) def test(self): - export('data', self.tempdir, verbose=0) + export(DATA_DIR, self.tempdir, verbose=0) self.assert_(exists(join(self.tempdir, '__init__.py'))) self.assert_(exists(join(self.tempdir, 'sub'))) self.assert_(not exists(join(self.tempdir, '__init__.pyc'))) @@ -83,8 +83,8 @@ class ExportTC(TestCase): class ProtectedFileTC(TestCase): def setUp(self): - self.rpath = 'data/write_protected_file.txt' - self.rwpath = 'data/normal_file.txt' + self.rpath = join(DATA_DIR, 'write_protected_file.txt') + self.rwpath = join(DATA_DIR, 'normal_file.txt') # Make sure rpath is not writable ! os.chmod(self.rpath, 33060) # Make sure rwpath is writable ! |