def setUp(self): self.dirLocalMan = fusedaap.LocalDirManager( fusedaap.DirInode('testDir')) self.dirLocalMan.fsRoot = self.dirLocalMan.fetchInode( '/') #bc __fsRoot is private self.firstLevel = ('dir1', 'dir2', 'dir3') self.secondLevel1 = ('dir1a', 'dir1b') self.secondLevel2 = ('dir2a', ) self.thirdLevel1a = ('songFile1', 'songFile2') self.dirPaths = ('/dir1', '/dir2', '/dir1/dir1a', '/dir1/dir1b', '/dir2/dir2a', '/dir2/dir2a') self.songPaths = ('/dir1/dir1a/songFile1', '/dir1/dir1a/songFile2') for f in self.firstLevel: self.dirLocalMan.fsRoot.addChild(fusedaap.DirInode(f)) for f in self.secondLevel1: self.dirLocalMan.fsRoot.children['dir1'].addChild( fusedaap.DirInode(f)) for f in self.secondLevel2: self.dirLocalMan.fsRoot.children['dir2'].addChild( fusedaap.DirInode(f)) for s in self.thirdLevel1a: self.dirLocalMan.fsRoot.children['dir1'].children[ 'dir1a'].addChild(fusedaap.SongInode(s, 5))
def setUp(self): self.dirLocalMan = fusedaap.LocalDirManager( fusedaap.DirInode('testDir')) self.songPaths = ('/dir1/dir1a/songFile1', '/dir1/dir1a/songFile2') self.dirPaths = ('/dir2', '/dir1/dir1a', '/dir1/dir1b', '/dir1' '/dir2/dir2a', '/dir2/dir2a')
def setUp(self): self.dirLocalMan = fusedaap.LocalDirManager( fusedaap.DirInode('testDir')) self.dirPaths = ('/dir2', '/dir1/dir1a', '/dir1', '/dir1/dir1a/removeme', '/dir2/dir2a', '/dir2/dir2a')
def test_fetchInodeMissingNode(self): """LocalDirManager.fetchInode should return None if inode does not exist.""" self.dirLocalMan = fusedaap.LocalDirManager( fusedaap.DirInode('testDir')) for f in self.dirPaths[1:]: self.assertEquals(None, self.dirLocalMan.fetchInode(f))