aboutsummaryrefslogtreecommitdiff
path: root/tests/test_utils_proc.py
blob: bea431fa84478f3b56a0127fe8e4dc2a5c1dd635 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# SPDX-FileCopyrightText: Copyright 2023, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
"""Tests for process management functions."""
from unittest.mock import MagicMock

from mlia.utils.proc import Command
from mlia.utils.proc import process_command_output


def test_process_command_output() -> None:
    """Test function process_command_output."""
    command = Command(["echo", "-n", "sample message"])

    output_consumer = MagicMock()
    process_command_output(command, [output_consumer])

    output_consumer.assert_called_once_with("sample message")