24 from tempfile import TemporaryDirectory |
24 from tempfile import TemporaryDirectory |
25 from unittest import TestCase |
25 from unittest import TestCase |
26 |
26 |
27 |
27 |
28 def newcube(directory, name): |
28 def newcube(directory, name): |
29 cmd = ['cubicweb-ctl', 'newcube', '--directory', directory, name] |
29 cmd = ['cubicweb-ctl', 'newcube', '--directory', directory, |
|
30 '--short-description', 'short_desc', name] |
30 proc = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=STDOUT) |
31 proc = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=STDOUT) |
31 stdout, _ = proc.communicate(b'short_desc\n') |
32 returncode = proc.wait() |
32 return proc.returncode, stdout |
33 return returncode, proc.stdout.read() |
33 |
34 |
34 |
35 |
35 def to_unicode(msg): |
36 def to_unicode(msg): |
36 return msg.decode(sys.getdefaultencoding(), errors='replace') |
37 return msg.decode(sys.getdefaultencoding(), errors='replace') |
37 |
38 |