mirror of
https://github.com/wassname/ray.git
synced 2026-08-11 05:51:40 +08:00
Correct actor class name and module. (#675)
* Correct actor class name and module. * Add test. * Fix linting.
This commit is contained in:
committed by
Philipp Moritz
parent
96962cdee0
commit
019ba07e9c
@@ -234,6 +234,25 @@ class ActorAPI(unittest.TestCase):
|
||||
|
||||
ray.worker.cleanup()
|
||||
|
||||
def testActorClassName(self):
|
||||
ray.init(num_workers=0)
|
||||
|
||||
@ray.remote
|
||||
class Foo(object):
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
Foo.remote()
|
||||
|
||||
r = ray.worker.global_worker.redis_client
|
||||
actor_keys = r.keys("ActorClass*")
|
||||
self.assertEqual(len(actor_keys), 1)
|
||||
actor_class_info = r.hgetall(actor_keys[0])
|
||||
self.assertEqual(actor_class_info[b"class_name"], b"Foo")
|
||||
self.assertEqual(actor_class_info[b"module"], b"__main__")
|
||||
|
||||
ray.worker.cleanup()
|
||||
|
||||
|
||||
class ActorMethods(unittest.TestCase):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user