Exemplo n.º 1
0
def test_path2fid_invalid_path( testdir ):
    """
    Verify that path2fid throws an error for an invalid path
    """
    f = testdir.objects.values()[0][0]
    path = '{0}xyz'.format( f.path )
    with pytest.raises( Run_Cmd_Error ) as einfo:
        FID = pylut.path2fid( path )
    assert einfo.value.code == 2
    assert 'No such file or directory' in einfo.value.reason
Exemplo n.º 2
0
def test_path2fid_invalid_path(testdir):
    """
    Verify that path2fid throws an error for an invalid path
    """
    f = testdir.objects.values()[0][0]
    path = '{0}xyz'.format(f.path)
    with pytest.raises(Run_Cmd_Error) as einfo:
        FID = pylut.path2fid(path)
    assert einfo.value.code == 2
    assert 'No such file or directory' in einfo.value.reason
Exemplo n.º 3
0
Arquivo: psync.py Projeto: ncsa/psync
def rm_dir( path, tmpbase ):
    """ Move the directory out of the way to be deleted later
    """
    fid = pylut.path2fid( path )
    tgt = os.path.join( tmpbase, fid )
    logr.info( synctype = 'RMDIR',
               msgtype  = 'start',
               src      = path,
               tgt      = tgt,
               action   = 'rename' )
    os.rename( path, tgt )
    logr.info( synctype = 'RMDIR',
               msgtype  = 'end',
               src      = path,
               tgt      = tgt )
Exemplo n.º 4
0
def test_path2fid_valid_path( testdir ):
    for inode, flist in testdir.objects.iteritems():
        for f in flist:
            fid = _path2fid( f.path )
            FID = pylut.path2fid( f.path )
            assert FID == fid
Exemplo n.º 5
0
def test_path2fid_valid_path(testdir):
    for inode, flist in testdir.objects.iteritems():
        for f in flist:
            fid = _path2fid(f.path)
            FID = pylut.path2fid(f.path)
            assert FID == fid