mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Switch to the correct fixture usage
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
d0f05e0558
commit
910c78d4e0
1 changed files with 4 additions and 6 deletions
|
@ -7,19 +7,17 @@ import salt.states.file as file
|
|||
from tests.support.mock import MagicMock, call, create_autospec, patch
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_loader(request):
|
||||
setup_loader_modules = {
|
||||
@pytest.fixture
|
||||
def configure_loader_modules(minion_opts):
|
||||
return {
|
||||
file: {
|
||||
"__opts__": {"test": False},
|
||||
"__env__": "base",
|
||||
}
|
||||
}
|
||||
with pytest.helpers.loader_mock(request, setup_loader_modules) as loader_mock:
|
||||
yield loader_mock
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
@pytest.fixture
|
||||
def fake_remove():
|
||||
fake_remove_mod = create_autospec(filemod.remove)
|
||||
with patch.dict(file.__salt__, {"file.remove": fake_remove_mod}):
|
||||
|
|
Loading…
Add table
Reference in a new issue