Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
bdd5e320
Commit
bdd5e320
authored
Apr 30, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: test io.BytesIO and io.StringIO in restricted environment
parent
dc2ef4ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testRestrictedPythonSecurity.py
...rtal_components/test.erp5.testRestrictedPythonSecurity.py
+20
-0
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testRestrictedPythonSecurity.py
View file @
bdd5e320
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment