summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2013-05-29 15:39:09 +0200
committerMartin Pitt <martinpitt@gnome.org>2013-05-29 15:42:52 +0200
commit9fcbba900c87a41a85281bec3ee1989258f3a3db (patch)
treed78a51b75aa21dfae3808b503b574ccdb4e9ed23
parent8f0ffa1f5b8c541f30d73b99aee8e2aab574c28d (diff)
gvfs-test: Fix for Python 3.3
Use read() instead of readall() for reading from subprocess, as this is a BufferedReader() now. This also works for older Python versions. Also, add another missing Popen.stdin.flush(), like in the previous commit.
-rwxr-xr-xtest/gvfs-test8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/gvfs-test b/test/gvfs-test
index 008e3be8..6c0fc119 100755
--- a/test/gvfs-test
+++ b/test/gvfs-test
@@ -935,7 +935,7 @@ class Drive(GvfsTestCase):
ctx = GLib.MainContext().default()
while ctx.iteration(False):
pass
- self.monitor.stdout.readall()
+ self.monitor.stdout.read()
def setUp(self):
self.mock_polkit = None
@@ -1203,7 +1203,7 @@ pkill --signal HUP udevd || pkill --signal HUP systemd-udevd
empty_timeout = 50
while True:
- out = self.monitor.stdout.readall()
+ out = self.monitor.stdout.read()
if out:
break
else:
@@ -1215,7 +1215,7 @@ pkill --signal HUP udevd || pkill --signal HUP systemd-udevd
# wait a bit more to see whether we catch some stragglers
time.sleep(0.2)
- out2 = self.monitor.stdout.readall()
+ out2 = self.monitor.stdout.read()
if out2:
out += out2
@@ -1229,6 +1229,8 @@ pkill --signal HUP udevd || pkill --signal HUP systemd-udevd
stdin=subprocess.PIPE)
self.mock_polkit.stdin.write(('set -e\n/home/test_polkitd.py -r -a %s\n'
% ','.join(actions)).encode('ASCII'))
+ self.mock_polkit.stdin.flush()
+
# wait until it started up
if actions:
timeout = 50