/
githubmirror
/
salt
Обзор
Документация
Войти
/
githubmirror
/
salt
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/pytests/functional/states/test_blockdev.py
26 строк
653 B
Barney Sowood
Fix issue with checking for non-blockdev devices
16 дек 2025, 13:10
16 дек 2025, 13:10
45b200d
Код
Авторство
О чём код?
import logging import pytest log = logging.getLogger(__name__) @pytest.fixture(scope="function") def non_blockdev_file(): with pytest.helpers.temp_file() as tmp_file: assert tmp_file.is_file() yield tmp_file def test_tuned_not_block_device(states, non_blockdev_file): """ Test to ensure that when the target is not a block device, the state returns False and a comment indicating the issue. """ name = str(non_blockdev_file) ret = states.blockdev.tuned( name=name, ) assert ret["result"] is False assert ret["comment"] == f"Changes to {name} cannot be applied. Not a block device."