mirror of
https://github.com/wassname/ray.git
synced 2026-08-04 13:14:14 +08:00
Disallow calling ray.put on an object ID. (#353)
This commit is contained in:
committed by
Philipp Moritz
parent
b463d9e5c7
commit
3b7788bf88
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user