Skip to content

Commit

Permalink
adding tests for set
Browse files Browse the repository at this point in the history
  • Loading branch information
ehfeng committed Feb 28, 2017
1 parent 092328a commit 9842dc8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/RestrictedPython/tests/restricted_module.py
Expand Up @@ -33,6 +33,11 @@ def try_map():
print map(inc, x),
return printed

def try_set():
x = [1, 1, 2, 3]
print set(x)
return printed

def try_apply():
def f(x, y, z):
return x + y + z
Expand Down
4 changes: 4 additions & 0 deletions src/RestrictedPython/tests/testRestrictions.py
Expand Up @@ -251,6 +251,10 @@ def checkTryMap(self):
res = self.execFunc('try_map')
self.assertEqual(res, "[2, 3, 4]")

def checkTrySet(self):
res = self.execFunc('try_set')
self.assertEqual(res, "set([1, 2, 3])")

def checkApply(self):
del apply_wrapper_called[:]
res = self.execFunc('try_apply')
Expand Down

0 comments on commit 9842dc8

Please sign in to comment.