- # Create the request handler
- operations = fuse.Operations(os.getuid(), os.getgid())
- e = operations.inodes.add_entry(fuse.CollectionDirectory(llfuse.ROOT_INODE, operations.inodes, self.api, 0, self.testcollection))
-
- llfuse.init(operations, self.mounttmp, [])
- t = threading.Thread(None, lambda: llfuse.main())
- t.start()
-
- # wait until the driver is finished initializing
- operations.initlock.wait()
-
- # now check some stuff
- d1 = os.listdir(self.mounttmp)
- d1.sort()
- self.assertEqual(['dir1', 'dir2', 'thing1.txt', 'thing2.txt'], d1)
-
- d2 = os.listdir(os.path.join(self.mounttmp, 'dir1'))
- d2.sort()
- self.assertEqual(['thing3.txt', 'thing4.txt'], d2)
-
- d3 = os.listdir(os.path.join(self.mounttmp, 'dir2'))
- d3.sort()
- self.assertEqual(['dir3', 'thing5.txt', 'thing6.txt'], d3)
-
- d4 = os.listdir(os.path.join(self.mounttmp, 'dir2/dir3'))
- d4.sort()
- self.assertEqual(['thing7.txt', 'thing8.txt'], d4)
+ self.make_mount(fuse.CollectionDirectory, collection=self.testcollection)
+
+ self.assertDirContents(None, ['thing1.txt', 'thing2.txt',
+ 'edgecases', 'dir1', 'dir2'])
+ self.assertDirContents('dir1', ['thing3.txt', 'thing4.txt'])
+ self.assertDirContents('dir2', ['thing5.txt', 'thing6.txt', 'dir3'])
+ self.assertDirContents('dir2/dir3', ['thing7.txt', 'thing8.txt'])
+ self.assertDirContents('edgecases',
+ "dirs/:/_/__/.../-/*/\x01\\/ ".split("/"))
+ self.assertDirContents('edgecases/dirs',
+ ":/__/.../-/*/\x01\\/ ".split("/"))