From 5aabd442f2b900f24ff28837806eec2a3819587d Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Wed, 28 Mar 2018 20:54:35 -0700 Subject: [PATCH] Fix up import and docstring syntax --- tests/unit/states/test_environ.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/unit/states/test_environ.py b/tests/unit/states/test_environ.py index f9f4dbb8e6..bbc58af559 100644 --- a/tests/unit/states/test_environ.py +++ b/tests/unit/states/test_environ.py @@ -14,8 +14,8 @@ from tests.support.mock import ( # Import salt libs import salt.states.environ as envstate import salt.modules.environ as envmodule -import salt.modules.reg as regmodule -import salt.utils as utils +import salt.modules.reg +import salt.utils class TestEnvironState(TestCase, LoaderModuleMockMixin): @@ -26,7 +26,7 @@ class TestEnvironState(TestCase, LoaderModuleMockMixin): '__opts__': {'test': False}, '__salt__': { 'environ.setenv': envmodule.setenv, - 'reg.read_value': regmodule.read_value, + 'reg.read_value': salt.modules.reg.read_value, } } return {envstate: loader_globals, envmodule: loader_globals} @@ -53,7 +53,7 @@ class TestEnvironState(TestCase, LoaderModuleMockMixin): ret = envstate.setenv('test', 'other') self.assertEqual(ret['changes'], {}) - @skipIf(not utils.is_windows(), 'Windows only') + @skipIf(not salt.utils.is_windows(), 'Windows only') def test_setenv_permanent(self): '''test that we can set perminent environment variables (requires pywin32)''' with patch.dict(envmodule.__salt__, {'reg.set_value': MagicMock(), 'reg.delete_value': MagicMock()}): @@ -89,7 +89,7 @@ class TestEnvironState(TestCase, LoaderModuleMockMixin): '''test that ``clear_all`` option sets other values to '' ''' ret = envstate.setenv('test', 'value', clear_all=True) self.assertEqual(ret['changes'], {'test': 'value', 'INITIAL': ''}) - if utils.is_windows(): + if salt.utils.is_windows(): self.assertEqual(envstate.os.environ, {'TEST': 'value', 'INITIAL': ''}) else: self.assertEqual(envstate.os.environ, {'test': 'value', 'INITIAL': ''}) @@ -99,7 +99,7 @@ class TestEnvironState(TestCase, LoaderModuleMockMixin): unsets other values from environment''' ret = envstate.setenv('test', 'value', false_unsets=True, clear_all=True) self.assertEqual(ret['changes'], {'test': 'value', 'INITIAL': None}) - if utils.is_windows(): + if salt.utils.is_windows(): self.assertEqual(envstate.os.environ, {'TEST': 'value'}) else: self.assertEqual(envstate.os.environ, {'test': 'value'}) @@ -113,7 +113,7 @@ class TestEnvironState(TestCase, LoaderModuleMockMixin): ret = envstate.setenv( 'notimportant', {'test': False, 'foo': 'baz'}, false_unsets=True) self.assertEqual(ret['changes'], {'test': None, 'foo': 'baz'}) - if utils.is_windows(): + if salt.utils.is_windows(): self.assertEqual(envstate.os.environ, {'INITIAL': 'initial', 'FOO': 'baz'}) else: self.assertEqual(envstate.os.environ, {'INITIAL': 'initial', 'foo': 'baz'}) @@ -121,7 +121,7 @@ class TestEnvironState(TestCase, LoaderModuleMockMixin): with patch.dict(envstate.__salt__, {'reg.read_value': MagicMock()}): ret = envstate.setenv('notimportant', {'test': False, 'foo': 'bax'}) self.assertEqual(ret['changes'], {'test': '', 'foo': 'bax'}) - if utils.is_windows(): + if salt.utils.is_windows(): self.assertEqual(envstate.os.environ, {'INITIAL': 'initial', 'FOO': 'bax', 'TEST': ''}) else: self.assertEqual(envstate.os.environ, {'INITIAL': 'initial', 'foo': 'bax', 'test': ''})