示例#1
0
 def testFileClass(self):
     for filename in self.testfiles:
         filename = os.path.join(tmpdir, self.testdir, filename)
         expected = TestFile(filename)
         if filename.endswith(os.path.sep):
             filename = filename[:-1]
         actual = sqlitecache.File(filename)
         self.assertFilesEqual(expected, actual)
示例#2
0
 def addPathToFileObjects(self, path, root):
     path = path.rstrip(os.path.sep)
     ref, base = os.path.split(path)
     if ref:
         if not ref in self.fileobjects:
             self.addPathToFileObjects(ref, root)
         parent = self.fileobjects[ref]
     else:
         parent = root
     fob = sqlitecache.File(base, parent=parent)
     self.id_fileobj(fob)
     self.fileobjects[path] = fob
示例#3
0
 def setupFileObjects(self):
     testpath = os.path.abspath(self.testdir)
     root = sqlitecache.File(testpath)
     self.fileobjects[''] = root
     for path in self.testfiles:
         self.addPathToFileObjects(path, root)