Fix pre commit

This commit is contained in:
Daniel A. Wozniak 2021-06-17 14:35:17 -07:00 committed by Megan Wilhite
parent d19de8d67f
commit d9d0a6806f
2 changed files with 8 additions and 6 deletions

View file

@ -1 +1,3 @@
# -*- coding: utf-8 -*-
"""
Unit tests for engines
"""

View file

@ -4,14 +4,14 @@ from tests.support.mock import MagicMock, patch
def test_engine_module_name():
engine = salt.engines.Engine('foobar', {}, 'foobar.start', {}, {}, {}, {})
assert engine.name == 'foobar'
engine = salt.engines.Engine("foobar", {}, "foobar.start", {}, {}, {}, {})
assert engine.name == "foobar"
def test_engine_title_set():
engine = salt.engines.Engine('foobar', {}, 'foobar.start', {}, {}, {}, {})
with patch('salt.utils.process.appendproctitle', MagicMock()) as mm:
engine = salt.engines.Engine("foobar", {}, "foobar.start", {}, {}, {}, {})
with patch("salt.utils.process.appendproctitle", MagicMock()) as mm:
with pytest.raises(KeyError):
# The method does not exist so a KeyError will be raised.
engine.run()
mm.assert_called_with('foobar')
mm.assert_called_with("foobar")