From 485f2203e05593eb3c849081f65605cab9c26163 Mon Sep 17 00:00:00 2001 From: Emmanuel Roullit Date: Mon, 20 Jul 2015 11:59:40 +0200 Subject: [PATCH] unittest: start server in a modified environment. This changes allows the user to run the unittests properly in a virtualenv setup. Once the venv activated, /usr/bin/env will point the python executable within the venv instead of the system one. Signed-off-by: Emmanuel Roullit --- unitest-restful.py | 2 +- unitest-xmlrpc.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unitest-restful.py b/unitest-restful.py index efd7e572..82ce53fc 100755 --- a/unitest-restful.py +++ b/unitest-restful.py @@ -79,7 +79,7 @@ class TestGlances(unittest.TestCase): global pid - cmdline = "/usr/bin/python -m glances -w -p %s" % SERVER_PORT + cmdline = "/usr/bin/env python -m glances -w -p %s" % SERVER_PORT print("Run the Glances Web Server on port %s" % SERVER_PORT) args = shlex.split(cmdline) pid = subprocess.Popen(args) diff --git a/unitest-xmlrpc.py b/unitest-xmlrpc.py index a6ea3083..6e71279e 100755 --- a/unitest-xmlrpc.py +++ b/unitest-xmlrpc.py @@ -86,7 +86,7 @@ class TestGlances(unittest.TestCase): global pid - cmdline = "/usr/bin/python -m glances -s -p %s" % SERVER_PORT + cmdline = "/usr/bin/env python -m glances -s -p %s" % SERVER_PORT print("Run the Glances Server on port %s" % SERVER_PORT) args = shlex.split(cmdline) pid = subprocess.Popen(args)