Disallow calling ray.put on an object ID. (#353)

This commit is contained in:
Robert Nishihara
2017-03-11 12:09:28 -08:00
committed by Philipp Moritz
parent b463d9e5c7
commit 3b7788bf88
2 changed files with 26 additions and 3 deletions
+13
View File
@@ -655,6 +655,19 @@ class APITest(unittest.TestCase):
ray.worker.cleanup()
def testIllegalAPICalls(self):
ray.init(num_workers=0)
# Verify that we cannot call put on an ObjectID.
x = ray.put(1)
with self.assertRaises(Exception):
ray.put(x)
# Verify that we cannot call get on a regular value.
with self.assertRaises(Exception):
ray.get(3)
ray.worker.cleanup()
class PythonModeTest(unittest.TestCase):
def testPythonMode(self):