1 from paste.util.import_string import * 2 import sys 3 import os 4 5 def test_simple(): 6 for func in eval_import, simple_import: 7 assert func('sys') is sys 8 assert func('sys.version') is sys.version 9 assert func('os.path.join') is os.path.join 10 11 def test_complex(): 12 assert eval_import('sys:version') is sys.version 13 assert eval_import('os:getcwd()') == os.getcwd() 14 assert (eval_import('sys:version.split()[0]') == 15 sys.version.split()[0]) 16 17