Changeset 754
- Timestamp:
- 07/18/07 22:24:25 (1 year ago)
- Files:
-
- pyrun/trunk/COPYING (added)
- pyrun/trunk/ChangeLog (added)
- pyrun/trunk/INSTALL.txt (added)
- pyrun/trunk/MANIFEST.in (added)
- pyrun/trunk/README.txt (added)
- pyrun/trunk/pkg-info.rst (added)
- pyrun/trunk/pyrun.html (added)
- pyrun/trunk/pyrun.py (added)
- pyrun/trunk/setup.py (added)
- pyrun/trunk/test_all.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pyrun/trunk/test_all.py
r752 r754 6 6 from os.path import abspath, join, dirname 7 7 from tempfile import mkdtemp 8 import pyrequire 8 9 9 10 def test_update_section_options(): 10 o = pyr un.update_section_options([])11 o = pyrequire.update_section_options([]) 11 12 assert not o 12 13 options = {} 13 o = pyr un.update_section_options([], options)14 o = pyrequire.update_section_options([], options) 14 15 assert options is o 15 o = pyr un.update_section_options([16 o = pyrequire.update_section_options([ 16 17 ('sec1', 'o1', '1'), 17 18 ('sec1', 'o2', '2'), … … 27 28 28 29 def test_get_fallback_paths(): 29 fbk, consume_arg = pyr un.get_fallback_paths([])30 fbk, consume_arg = pyrequire.get_fallback_paths([]) 30 31 assert not fbk 31 fbk2, consume_arg = pyr un.get_fallback_paths([], fbk)32 fbk2, consume_arg = pyrequire.get_fallback_paths([], fbk) 32 33 assert fbk2 is fbk 33 fbk, consume_arg = pyr un.get_fallback_paths(['-o'])34 fbk, consume_arg = pyrequire.get_fallback_paths(['-o']) 34 35 assert not fbk 35 fbk, consume_arg = pyr un.get_fallback_paths(['--o'])36 fbk, consume_arg = pyrequire.get_fallback_paths(['--o']) 36 37 assert not fbk 37 fbk, consume_arg = pyr un.get_fallback_paths(['='])38 fbk, consume_arg = pyrequire.get_fallback_paths(['=']) 38 39 assert not fbk 39 fbk, consume_arg = pyr un.get_fallback_paths([':='])40 fbk, consume_arg = pyrequire.get_fallback_paths([':=']) 40 41 assert not fbk 41 fbk, consume_arg = pyr un.get_fallback_paths([':'])42 fbk, consume_arg = pyrequire.get_fallback_paths([':']) 42 43 assert not fbk 43 fbk, consume_arg = pyr un.get_fallback_paths(['.'])44 fbk, consume_arg = pyrequire.get_fallback_paths(['.']) 44 45 assert len(fbk) == 1 and abspath('.') == fbk[0] 45 46 … … 78 79 return path in fmap 79 80 80 fbk, consume_arg = pyr un.get_fallback_paths(['foo'],81 fbk, consume_arg = pyrequire.get_fallback_paths(['foo'], 81 82 openfile=openfile, 82 83 pathexists=pathexists … … 84 85 assert not fbk 85 86 86 fbk, consume_arg = pyr un.get_fallback_paths([join(basedir, 'empty.pth')],87 fbk, consume_arg = pyrequire.get_fallback_paths([join(basedir, 'empty.pth')], 87 88 openfile=openfile, 88 89 pathexists=pathexists 89 90 ) 90 91 assert not fbk 91 fbk, consume_arg = pyr un.get_fallback_paths([join(basedir, 'nonewline.pth')],92 fbk, consume_arg = pyrequire.get_fallback_paths([join(basedir, 'nonewline.pth')], 92 93 openfile=openfile, 93 94 pathexists=pathexists 94 95 ) 95 96 assert fbk and fbk[0]==fmap[join(basedir, 'nonewline.pth')] 96 tmpdir = mkdtemp('-pyr un_test_all_get_fallback_paths')97 tmpdir = mkdtemp('-pyrequire_test_all_get_fallback_paths') 97 98 os.chdir(tmpdir) 98 99 try: 99 fbk, consume_arg = pyr un.get_fallback_paths([join(basedir, 'linesandcomments.pth')],100 fbk, consume_arg = pyrequire.get_fallback_paths([join(basedir, 'linesandcomments.pth')], 100 101 openfile=openfile, 101 102 pathexists=pathexists … … 106 107 107 108 # verify all paths are considered only in there absolute form 108 fbk, consume_arg = pyr un.get_fallback_paths([join(basedir, 'relative.pth')],109 fbk, consume_arg = pyrequire.get_fallback_paths([join(basedir, 'relative.pth')], 109 110 openfile=openfile, 110 111 pathexists=pathexists