Commit 4d2b85c1 authored by Michal Čihař's avatar Michal Čihař

Fix script tests for Python 3

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 899ebf1e
...@@ -34,10 +34,12 @@ class ScriptTest(RepoTestCase): ...@@ -34,10 +34,12 @@ class ScriptTest(RepoTestCase):
def setUp(self): def setUp(self):
super(ScriptTest, self).setUp() super(ScriptTest, self).setUp()
self.output = tempfile.NamedTemporaryFile(delete=False) self.output = tempfile.NamedTemporaryFile(delete=False)
self.script = tempfile.NamedTemporaryFile(delete=False) self.script = tempfile.NamedTemporaryFile(delete=False, mode='wb+')
self.output.close() self.output.close()
self.script.write('#!/bin/sh\n') self.script.write(b'#!/bin/sh\n')
self.script.write('echo "$WL_PATH" >> {0}\n'.format(self.output.name)) self.script.write(b'echo "$WL_PATH" >> ')
self.script.write(self.output.name.encode('utf-8'))
self.script.write(b'\n')
self.script.close() self.script.close()
file_stat = os.stat(self.script.name) file_stat = os.stat(self.script.name)
os.chmod(self.script.name, file_stat.st_mode | stat.S_IEXEC) os.chmod(self.script.name, file_stat.st_mode | stat.S_IEXEC)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment