Changeset 754

Show
Ignore:
Timestamp:
07/18/07 22:24:25 (1 year ago)
Author:
robin
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • pyrun/trunk/test_all.py

    r752 r754  
    66from os.path import abspath, join, dirname 
    77from tempfile import mkdtemp 
     8import pyrequire 
    89 
    910def test_update_section_options(): 
    10     o = pyrun.update_section_options([]) 
     11    o = pyrequire.update_section_options([]) 
    1112    assert not o 
    1213    options = {} 
    13     o = pyrun.update_section_options([], options) 
     14    o = pyrequire.update_section_options([], options) 
    1415    assert options is o 
    15     o = pyrun.update_section_options([ 
     16    o = pyrequire.update_section_options([ 
    1617        ('sec1', 'o1', '1'), 
    1718        ('sec1', 'o2', '2'), 
     
    2728 
    2829def test_get_fallback_paths(): 
    29     fbk, consume_arg = pyrun.get_fallback_paths([]) 
     30    fbk, consume_arg = pyrequire.get_fallback_paths([]) 
    3031    assert not fbk 
    31     fbk2, consume_arg = pyrun.get_fallback_paths([], fbk) 
     32    fbk2, consume_arg = pyrequire.get_fallback_paths([], fbk) 
    3233    assert fbk2 is fbk 
    33     fbk, consume_arg = pyrun.get_fallback_paths(['-o']) 
     34    fbk, consume_arg = pyrequire.get_fallback_paths(['-o']) 
    3435    assert not fbk 
    35     fbk, consume_arg = pyrun.get_fallback_paths(['--o']) 
     36    fbk, consume_arg = pyrequire.get_fallback_paths(['--o']) 
    3637    assert not fbk 
    37     fbk, consume_arg = pyrun.get_fallback_paths(['=']) 
     38    fbk, consume_arg = pyrequire.get_fallback_paths(['=']) 
    3839    assert not fbk 
    39     fbk, consume_arg = pyrun.get_fallback_paths([':=']) 
     40    fbk, consume_arg = pyrequire.get_fallback_paths([':=']) 
    4041    assert not fbk 
    41     fbk, consume_arg = pyrun.get_fallback_paths([':']) 
     42    fbk, consume_arg = pyrequire.get_fallback_paths([':']) 
    4243    assert not fbk 
    43     fbk, consume_arg = pyrun.get_fallback_paths(['.']) 
     44    fbk, consume_arg = pyrequire.get_fallback_paths(['.']) 
    4445    assert len(fbk) == 1 and abspath('.') == fbk[0] 
    4546 
     
    7879        return path in fmap 
    7980 
    80     fbk, consume_arg = pyrun.get_fallback_paths(['foo'], 
     81    fbk, consume_arg = pyrequire.get_fallback_paths(['foo'], 
    8182            openfile=openfile, 
    8283            pathexists=pathexists 
     
    8485    assert not fbk 
    8586 
    86     fbk, consume_arg = pyrun.get_fallback_paths([join(basedir, 'empty.pth')], 
     87    fbk, consume_arg = pyrequire.get_fallback_paths([join(basedir, 'empty.pth')], 
    8788            openfile=openfile, 
    8889            pathexists=pathexists 
    8990            ) 
    9091    assert not fbk 
    91     fbk, consume_arg = pyrun.get_fallback_paths([join(basedir, 'nonewline.pth')], 
     92    fbk, consume_arg = pyrequire.get_fallback_paths([join(basedir, 'nonewline.pth')], 
    9293            openfile=openfile, 
    9394            pathexists=pathexists 
    9495            ) 
    9596    assert fbk and fbk[0]==fmap[join(basedir, 'nonewline.pth')] 
    96     tmpdir = mkdtemp('-pyrun_test_all_get_fallback_paths') 
     97    tmpdir = mkdtemp('-pyrequire_test_all_get_fallback_paths') 
    9798    os.chdir(tmpdir) 
    9899    try: 
    99         fbk, consume_arg = pyrun.get_fallback_paths([join(basedir, 'linesandcomments.pth')], 
     100        fbk, consume_arg = pyrequire.get_fallback_paths([join(basedir, 'linesandcomments.pth')], 
    100101                openfile=openfile, 
    101102                pathexists=pathexists 
     
    106107 
    107108        # verify all paths are considered only in there absolute form 
    108         fbk, consume_arg = pyrun.get_fallback_paths([join(basedir, 'relative.pth')], 
     109        fbk, consume_arg = pyrequire.get_fallback_paths([join(basedir, 'relative.pth')], 
    109110                openfile=openfile, 
    110111                pathexists=pathexists