mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-24 23:37:18 +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
|
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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user