summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2013-07-05 16:40:12 +0200
committerBastien Nocera <hadess@hadess.net>2013-07-05 16:59:02 +0200
commit37ecf4f5840e1ac7dafe0270599b6e5bc4e56059 (patch)
treea8b086260e9344c75ce99bff9a6fc8570f1c44e3 /tests
parent1c9cdd6a5556aaad0fd4209a42dc2e54de2afc42 (diff)
downloadgnome-settings-daemon-37ecf4f5840e1ac7dafe0270599b6e5bc4e56059.tar.gz
tests: Simplify Xorg check
Diffstat (limited to 'tests')
-rw-r--r--tests/gsdtestcase.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/gsdtestcase.py b/tests/gsdtestcase.py
index df2159de..23a51416 100644
--- a/tests/gsdtestcase.py
+++ b/tests/gsdtestcase.py
@@ -14,6 +14,8 @@ import shutil
import sys
from glob import glob
+from gi.repository import GLib
+
try:
import dbusmock
except ImportError:
@@ -185,9 +187,8 @@ class GSDTestCase(dbusmock.DBusTestCase):
# some distros like Fedora install Xorg as suid root; copy it into our
# workdir to drop the suid bit and run it as user
- which = subprocess.Popen(['which', 'Xorg'], stdout=subprocess.PIPE)
- out = which.communicate()[0].strip()
- if which.returncode != 0 or not out:
+ out = GLib.find_program_in_path ('Xorg')
+ if not out:
sys.stderr.write('ERROR: Xorg not installed\n')
sys.exit(1)
xorg = os.path.join(klass.workdir, 'Xorg')