-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from zopefoundation/slice_as_safe_builtin
Add `slice()` to safe_builtins.
- Loading branch information
Showing
4 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from RestrictedPython._compat import IS_PY3 | ||
|
||
import pytest | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from RestrictedPython.Guards import safe_builtins | ||
from tests import e_eval | ||
|
||
import pytest | ||
|
||
|
||
@pytest.mark.parametrize(*e_eval) | ||
def test_Guards__safe_builtins__1(e_eval): | ||
"""It contains `slice()`.""" | ||
restricted_globals = dict(__builtins__=safe_builtins) | ||
assert e_eval('slice(1)', restricted_globals) == slice(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters