mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-24 15:27:17 +00:00
pass no report to handlers
This commit is contained in:
parent
74b18ff3e5
commit
ea421712a6
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user