summaryrefslogtreecommitdiffstats
path: root/pym/portage/tests/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'pym/portage/tests/__init__.py')
-rw-r--r--pym/portage/tests/__init__.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/pym/portage/tests/__init__.py b/pym/portage/tests/__init__.py
index 8676c6ae2..4a5ced8a3 100644
--- a/pym/portage/tests/__init__.py
+++ b/pym/portage/tests/__init__.py
@@ -3,14 +3,21 @@
# Distributed under the terms of the GNU General Public License v2
# $Id$
-import os
import sys
import time
import unittest
+from portage import os
+from portage import _fs_encoding
+from portage import _unicode_encode
+from portage import _unicode_decode
+
def main():
- TEST_FILE = '__test__'
+ TEST_FILE = _unicode_encode('__test__',
+ encoding=_fs_encoding, errors='strict')
+ svn_dirname = _unicode_encode('.svn',
+ encoding=_fs_encoding, errors='strict')
suite = unittest.TestSuite()
basedir = os.path.dirname(os.path.realpath(__file__))
testDirs = []
@@ -19,8 +26,14 @@ def main():
# I was tired of adding dirs to the list, so now we add __test__
# to each dir we want tested.
for root, dirs, files in os.walk(basedir):
- if ".svn" in dirs:
- dirs.remove('.svn')
+ if svn_dirname in dirs:
+ dirs.remove(svn_dirname)
+ try:
+ root = _unicode_decode(root,
+ encoding=_fs_encoding, errors='strict')
+ except UnicodeDecodeError:
+ continue
+
if TEST_FILE in files:
testDirs.append(root)