diff options
| author | ianb <devnull@localhost> | 2005-08-22 21:08:12 +0000 |
|---|---|---|
| committer | ianb <devnull@localhost> | 2005-08-22 21:08:12 +0000 |
| commit | c77d41d16bfadbfbba203a65ac5777545958755d (patch) | |
| tree | ea840880287aeb07b3bcb96dd055178cb3d9c878 /tests | |
| parent | 3359489aa9684e4c2a960561b9ce259c938b3948 (diff) | |
| download | paste-c77d41d16bfadbfbba203a65ac5777545958755d.tar.gz | |
Moved test
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_import_string.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_import_string.py b/tests/test_import_string.py new file mode 100644 index 0000000..96526ac --- /dev/null +++ b/tests/test_import_string.py @@ -0,0 +1,16 @@ +from paste.util.import_string import * +import sys +import os + +def test_simple(): + for func in eval_import, simple_import: + assert func('sys') is sys + assert func('sys.version') is sys.version + assert func('os.path.join') is os.path.join + +def test_complex(): + assert eval_import('sys:version') is sys.version + assert eval_import('os:getcwd()') == os.getcwd() + assert (eval_import('sys:version.split()[0]') == + sys.version.split()[0]) + |
