Commit a8fd091c authored by Jérome Perrin's avatar Jérome Perrin

test: test io.BytesIO and io.StringIO in restricted environment

parent f4d9ba61
...@@ -482,6 +482,26 @@ class TestRestrictedPythonSecurity(ERP5TypeTestCase): ...@@ -482,6 +482,26 @@ class TestRestrictedPythonSecurity(ERP5TypeTestCase):
expected="ok" expected="ok"
) )
def test_io_StringIO(self):
self.createAndRunScript('''
import io
s = io.StringIO()
s.write(u"ok")
return s.getvalue()
''',
expected=u"ok"
)
def test_io_BytesIO(self):
self.createAndRunScript('''
import io
s = io.BytesIO()
s.write(b"ok")
return s.getvalue()
''',
expected=b"ok"
)
def testNumpy(self): def testNumpy(self):
self.createAndRunScript(''' self.createAndRunScript('''
import numpy as np import numpy as np
......
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