Skip to content

Commit

Permalink
moved tests around
Browse files Browse the repository at this point in the history
  • Loading branch information
loechel committed Sep 22, 2016
1 parent 6031229 commit 60118c5
Show file tree
Hide file tree
Showing 6 changed files with 383 additions and 39 deletions.
18 changes: 8 additions & 10 deletions src/RestrictedPython/__init__.py
Expand Up @@ -12,24 +12,22 @@
##############################################################################
"""RestrictedPython package."""

# Old API --> Old Import Locations
from RestrictedPython.RCompile import compile_restricted
from RestrictedPython.RCompile import compile_restricted_eval
from RestrictedPython.RCompile import compile_restricted_exec
from RestrictedPython.RCompile import compile_restricted_function

# new API Style
#from RestrictedPython.compiler import compile_restricted
#from RestrictedPython.compiler import compile_restricted_eval
#from RestrictedPython.compiler import compile_restricted_exec
#from RestrictedPython.compiler import compile_restricted_function

from RestrictedPython.PrintCollector import PrintCollector

from RestrictedPython.Eval import RestrictionCapableEval

from RestrictedPython.Guards import safe_builtins
from RestrictedPython.Utilities import utility_builtins
from RestrictedPython.Limits import limited_builtins

from zope.deprecation import deprecation

compile_restricted_eval = deprecation.deprecated(compile_restricted_eval, 'compile_restricted_eval is deprecated, please use compile_restricted(source, filename, mode="eval") instead')
compile_restricted_exec = deprecation.deprecated(compile_restricted_exec, 'compile_restricted_exec is deprecated, please use compile_restricted(source, filename, mode="exec") instead')
compile_restricted_function = deprecation.deprecated(compile_restricted_function, 'compile_restricted_function is deprecated, please use compile_restricted(source, filename, mode="single") instead')
RestrictionCapableEval = deprecation.deprecated(RestrictionCapableEval, 'RestrictionCapableEval is deprecated, please use instead.')

# new API Style
#from RestrictedPython.compiler import compile_restricted
3 changes: 2 additions & 1 deletion src/RestrictedPython/tests/testCompile.py
Expand Up @@ -12,13 +12,14 @@
#
##############################################################################


# Ported
from RestrictedPython.RCompile import niceParse

import compiler.ast
import unittest


# Ported --> test_niceParse.py
class CompileTests(unittest.TestCase):

def testUnicodeSource(self):
Expand Down
1 change: 1 addition & 0 deletions src/RestrictedPython/tests/testUtiliities.py
Expand Up @@ -16,6 +16,7 @@
import unittest


# Ported to test_utilities.py
class UtilitiesTests(unittest.TestCase):

def test_string_in_utility_builtins(self):
Expand Down

0 comments on commit 60118c5

Please sign in to comment.