Fixed lint issues

This commit is contained in:
Daniel Hobley 2015-09-01 13:56:43 +02:00
parent fc724158de
commit 1c8e6e067f
4 changed files with 7 additions and 9 deletions

View File

@ -67,7 +67,7 @@ def setval(key, val, false_unsets=False, permanent=False):
permanent_key = 'Environment'
if permanent == 'HKLM':
permanent_hive = 'HKLM'
permanent_key = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
permanent_key = r'SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
if not isinstance(key, six.string_types):
log.debug(

View File

@ -122,7 +122,7 @@ def setenv(name,
permanent_key = 'Environment'
if permanent == 'HKLM':
permanent_hive = 'HKLM'
permanent_key = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
permanent_key = r'SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
out = __salt__['reg.read_value'](permanent_hive, permanent_key, key)
return out['success'] is True

View File

@ -57,15 +57,15 @@ class EnvironTestCase(TestCase):
environ.__salt__['reg.delete_value'] = MagicMock()
environ.setval('key', 'Test', permanent=True)
environ.__salt__['reg.set_value'].assert_called_with("HKCU", "Environment", 'key', 'Test')
environ.__salt__['reg.set_value'].assert_called_with('HKCU', 'Environment', 'key', 'Test')
environ.setval('key', False, false_unsets=True, permanent=True)
environ.__salt__['reg.set_value'].asset_not_called()
environ.__salt__['reg.delete_value'].assert_called_with('HKCU', 'Environment', 'key')
key = "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
environ.setval('key', 'Test', permanent="HKLM")
environ.__salt__['reg.set_value'].assert_called_with("HKLM", key, 'key', 'Test')
key = r'SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
environ.setval('key', 'Test', permanent='HKLM')
environ.__salt__['reg.set_value'].assert_called_with('HKLM', key, 'key', 'Test')
def test_setenv(self):
'''

View File

@ -9,9 +9,7 @@ from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_REASON
patch
)
ensure_in_syspath('../../')