pass no report to handlers

This commit is contained in:
Evgenii Alekseev 2021-09-09 00:17:44 +03:00
parent 74b18ff3e5
commit ea421712a6
2 changed files with 4 additions and 3 deletions

View File

@ -60,7 +60,7 @@ class Spawn(Thread):
self.queue: Queue[Tuple[str, Optional[Exception]]] = Queue() # pylint: disable=unsubscriptable-object
@staticmethod
def process(callback: Callable[[argparse.Namespace, str, Configuration], None],
def process(callback: Callable[[argparse.Namespace, str, Configuration, bool], None],
args: argparse.Namespace, architecture: str, configuration: Configuration,
process_id: str, queue: Queue[Tuple[str, Optional[Exception]]]) -> None: # pylint: disable=unsubscriptable-object
"""
@ -73,7 +73,7 @@ class Spawn(Thread):
:param queue: output queue
"""
try:
callback(args, architecture, configuration)
callback(args, architecture, configuration, args.no_report)
error = None
except Exception as e:
error = e

View File

@ -9,11 +9,12 @@ def test_process(spawner: Spawn) -> None:
must process external process run correctly
"""
args = MagicMock()
args.no_report = False
callback = MagicMock()
spawner.process(callback, args, spawner.architecture, spawner.configuration, "id", spawner.queue)
callback.assert_called_with(args, spawner.architecture, spawner.configuration)
callback.assert_called_with(args, spawner.architecture, spawner.configuration, False)
(uuid, error) = spawner.queue.get()
assert uuid == "id"
assert error is None