mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix linter
This commit is contained in:
parent
4e6a5de2fd
commit
d19de8d67f
2 changed files with 8 additions and 7 deletions
|
@ -116,7 +116,7 @@ class Engine(salt.utils.process.SignalHandlingProcess):
|
|||
"""
|
||||
Run the master service!
|
||||
"""
|
||||
salt.utils.process.appendproctitle("Engine: {}".format(self.name))
|
||||
salt.utils.process.appendproctitle(self.name)
|
||||
self.utils = salt.loader.utils(self.opts, proxy=self.proxy)
|
||||
if salt.utils.platform.is_windows():
|
||||
# Calculate function references since they can't be pickled.
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
import salt.engines
|
||||
import pytest
|
||||
from tests.support.mock import patch, MagicMock
|
||||
import salt.engines
|
||||
from tests.support.mock import MagicMock, patch
|
||||
|
||||
|
||||
def test_engine_module_name():
|
||||
engine = salt.engines.Engine({}, 'foobar.start', {}, {}, {}, {})
|
||||
assert engine.module_name == 'foobar'
|
||||
engine = salt.engines.Engine('foobar', {}, 'foobar.start', {}, {}, {}, {})
|
||||
assert engine.name == 'foobar'
|
||||
|
||||
|
||||
def test_engine_title_set():
|
||||
engine = salt.engines.Engine({}, 'foobar.start', {}, {}, {}, {})
|
||||
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('Engine: foobar')
|
||||
mm.assert_called_with('foobar')
|
||||
|
|
Loading…
Add table
Reference in a new issue