viff

changeset 883:bc925f4aa978

Correct PYTHONPATH when testing applications.
author Martin Geisler <mg@daimi.au.dk>
date Sat, 09 Aug 2008 14:43:17 +0200
parents 794a38489a2d
children 74860b8b1b98
files viff/test/test_apps.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/viff/test/test_apps.py	Fri Aug 08 13:51:18 2008 +0200
     1.2 +++ b/viff/test/test_apps.py	Sat Aug 09 14:43:17 2008 +0200
     1.3 @@ -43,8 +43,12 @@
     1.4  
     1.5      def setUp(self):
     1.6          """Switch to apps/ directory and generate config files."""
     1.7 +        root_dir = path.abspath(path.join(path.dirname(__file__), "..", ".."))
     1.8 +        if root_dir not in os.environ["PYTHONPATH"]:
     1.9 +            os.environ["PYTHONPATH"] += os.pathsep + root_dir
    1.10 +
    1.11          self.oldcwd = os.getcwd()
    1.12 -        os.chdir(path.join(path.dirname(__file__), '..', '..', 'apps'))
    1.13 +        os.chdir(path.join(root_dir, 'apps'))
    1.14  
    1.15          p = execute('generate-config-files.py', '-n', '3', '-t', '1',
    1.16                      'localhost:10000', 'localhost:20000', 'localhost:30000')