| 48 | |
| 49 | |
| 50 | class FakeRemoteActorClass: |
| 51 | def __init__(self, fake_ray, actor_class, options=None): |
| 52 | self.fake_ray = fake_ray |
| 53 | self.actor_class = actor_class |
| 54 | self._options = dict(options or {}) |
| 55 | |
| 56 | def options(self, **kwargs): |
| 57 | merged = dict(self._options) |
| 58 | merged.update(kwargs) |
| 59 | self.fake_ray.option_calls.append(merged) |
| 60 | return FakeRemoteActorClass(self.fake_ray, self.actor_class, merged) |
| 61 | |
| 62 | def remote(self, *args, **kwargs): |
| 63 | actor = FakeActorHandle(self.actor_class(*args, **kwargs), dict(self._options)) |
| 64 | self.fake_ray.actors.append(actor) |
| 65 | return actor |
| 66 | |
| 67 | |
| 68 | class FakeRayModule: |