Create instance of the wrapped class and execute operations on it as requested by the parent process.
(self)
| 320 | self._timeout = timeout |
| 321 | |
| 322 | def run(self): |
| 323 | """ |
| 324 | Create instance of the wrapped class and execute operations |
| 325 | on it as requested by the parent process. |
| 326 | """ |
| 327 | self._instance = self._cls(*self._args, **self._kwargs) |
| 328 | while True: |
| 329 | try: |
| 330 | rv = None |
| 331 | # get request from the parent process |
| 332 | op, path, args, kwargs = self._pipe[RemoteClass.PIPE_CHILD].recv() |
| 333 | args = self._deserialize(args) |
| 334 | kwargs = self._deserialize(kwargs) |
| 335 | path = path.split(".") if path else [] |
| 336 | if op == RemoteClass.GET: |
| 337 | rv = self._get_local_value(path) |
| 338 | elif op == RemoteClass.CALL: |
| 339 | rv = self._call_local_method(path, *args, **kwargs) |
| 340 | elif op == RemoteClass.SETATTR and "value" in kwargs: |
| 341 | self._set_local_attr(path, kwargs["value"]) |
| 342 | elif op == RemoteClass.REPR: |
| 343 | rv = self._get_local_repr(path) |
| 344 | elif op == RemoteClass.STR: |
| 345 | rv = self._get_local_str(path) |
| 346 | elif op == RemoteClass.QUIT: |
| 347 | break |
| 348 | else: |
| 349 | continue |
| 350 | # send return value |
| 351 | if not self._serializable(rv): |
| 352 | rv = self._make_serializable(rv) |
| 353 | self._pipe[RemoteClass.PIPE_CHILD].send(rv) |
| 354 | except EOFError: |
| 355 | break |
| 356 | self._instance = None # destroy the instance |
| 357 | |
| 358 | |
| 359 | @unittest.skip("Remote Vpp Test Case Class") |
nothing calls this directly
no test coverage detected