Пример #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
Пример #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
Пример #3
0
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 )
Пример #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
Пример #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