def test_next_success(self): raise SkipTest("need to solve issue with dependency on gluster.so") def mock_glfs_readdir_r(fd, ent, cursor): cursor.contents = "bla" return 0 with patch("gluster.gfapi.api.glfs_readdir_r", mock_glfs_readdir_r): fd = Dir(2) ent = fd.next() self.assertTrue(isinstance(ent, api.Dirent))