def test_fid2path_invalid_fid( testdir ): """ Verify that fid2path throws an error for an invalid path """ invalid_fids = [ '[0xffffffffff:0xfffff:0x0]', '[0xeeeeeeeeee:0xeeeee:0x0]' ] mnt = _getmountpoint( testdir.objects.values()[0][0].path ) for fid in invalid_fids: with pytest.raises( Run_Cmd_Error ) as einfo: pylut.fid2path( mnt, fid ) assert einfo.value.code == 2 assert 'No such file or directory' in einfo.value.reason
def test_fid2path_invalid_fid(testdir): """ Verify that fid2path throws an error for an invalid path """ invalid_fids = ['[0xffffffffff:0xfffff:0x0]', '[0xeeeeeeeeee:0xeeeee:0x0]'] mnt = _getmountpoint(testdir.objects.values()[0][0].path) for fid in invalid_fids: with pytest.raises(Run_Cmd_Error) as einfo: pylut.fid2path(mnt, fid) assert einfo.value.code == 2 assert 'No such file or directory' in einfo.value.reason
def test_fid2path_valid_fids( testdir ): """ Verify that FID's with multiple links return the correct number of paths """ for inode, flist in testdir.objects.iteritems(): numlinks = len( flist ) for f in flist: mnt = _getmountpoint( f.path ) fid = _path2fid( f.path ) paths = pylut.fid2path( mnt, fid ) assert len( paths ) == numlinks abspath = os.path.abspath( f.path ) assert abspath in paths
def test_fid2path_valid_fids(testdir): """ Verify that FID's with multiple links return the correct number of paths """ for inode, flist in testdir.objects.iteritems(): numlinks = len(flist) for f in flist: mnt = _getmountpoint(f.path) fid = _path2fid(f.path) paths = pylut.fid2path(mnt, fid) assert len(paths) == numlinks abspath = os.path.abspath(f.path) assert abspath in paths