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 self.queue: Queue[Tuple[str, Optional[Exception]]] = Queue() # pylint: disable=unsubscriptable-object
@staticmethod @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, args: argparse.Namespace, architecture: str, configuration: Configuration,
process_id: str, queue: Queue[Tuple[str, Optional[Exception]]]) -> None: # pylint: disable=unsubscriptable-object 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 :param queue: output queue
""" """
try: try:
callback(args, architecture, configuration) callback(args, architecture, configuration, args.no_report)
error = None error = None
except Exception as e: except Exception as e:
error = e error = e

View File

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