Added handles for python to access buffers in objstore (#282)

This commit is contained in:
Wapaul1
2016-07-20 17:36:15 -07:00
committed by Philipp Moritz
parent 3bf46ce5ac
commit b68512ec7d
4 changed files with 102 additions and 0 deletions
+8
View File
@@ -136,6 +136,14 @@ class ObjStoreTest(unittest.TestCase):
self.assertEqual(data[0], result[0])
self.assertTrue(np.alltrue(data[1] == result[1]))
# Getting a buffer after modifying it before it finishes should return updated buffer
objref = ray.lib.get_objref(w1.handle)
buf = ray.libraylib.allocate_buffer(w1.handle, objref, 100)
buf[0][0] = 1
ray.libraylib.finish_buffer(w1.handle, objref, buf[1], 0)
completedbuffer = ray.libraylib.get_buffer(w1.handle, objref)
self.assertEqual(completedbuffer[0][0], 1)
ray.services.cleanup()
class WorkerTest(unittest.TestCase):