diff options
author | Marc Abramowitz <marc@marc-abramowitz.com> | 2016-03-07 18:52:36 -0800 |
---|---|---|
committer | Marc Abramowitz <marc@marc-abramowitz.com> | 2016-03-07 18:52:36 -0800 |
commit | cc83e06efff71b81ca5a3ac6df65775971181295 (patch) | |
tree | d52fa3f1a93730f263c2c5ac8266de8e5fb12abf /tests/test_import_string.py | |
download | paste-git-tox_coverage.tar.gz |
tox.ini: Measure test coveragetox_coverage
Diffstat (limited to 'tests/test_import_string.py')
-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..262cbdd --- /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]) + |