mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix linter warts
This commit is contained in:
parent
fd702bdd44
commit
9fa9dab8b2
1 changed files with 7 additions and 9 deletions
|
@ -8,10 +8,10 @@ from __future__ import absolute_import, print_function, unicode_literals
|
|||
import os
|
||||
import sys
|
||||
import logging
|
||||
import shutil
|
||||
|
||||
# Import Salt libs
|
||||
import salt.utils.templates
|
||||
import salt.utils.files
|
||||
|
||||
# Import Salt Testing Libs
|
||||
from tests.support.helpers import with_tempdir
|
||||
|
@ -198,9 +198,8 @@ class WrapRenderTestCase(TestCase):
|
|||
|
||||
@with_tempdir()
|
||||
def test_wrap_issue_56119_a(self, tempdir):
|
||||
assert os.path.exists(tempdir)
|
||||
slsfile = os.path.join(tempdir, 'foo')
|
||||
with open(slsfile, 'w') as fp:
|
||||
with salt.utils.files.fopen(slsfile, 'w') as fp:
|
||||
fp.write('{{ slspath }}')
|
||||
context = {'opts': {}, 'saltenv': 'base', 'sls': 'foo.bar'}
|
||||
render = MockRender()
|
||||
|
@ -210,14 +209,13 @@ class WrapRenderTestCase(TestCase):
|
|||
context=context,
|
||||
tmplpath='/tmp/foo/bar/init.sls'
|
||||
)
|
||||
assert render.context['slspath'] == 'foo/bar'
|
||||
assert render.context['tpldir'] == 'foo/bar'
|
||||
assert render.context['slspath'] == 'foo/bar'
|
||||
assert render.context['tpldir'] == 'foo/bar'
|
||||
|
||||
@with_tempdir()
|
||||
def test_wrap_issue_56119_b(self, tempdir):
|
||||
assert os.path.exists(tempdir)
|
||||
slsfile = os.path.join(tempdir, 'foo')
|
||||
with open(slsfile, 'w') as fp:
|
||||
with salt.utils.files.fopen(slsfile, 'w') as fp:
|
||||
fp.write('{{ slspath }}')
|
||||
context = {'opts': {}, 'saltenv': 'base', 'sls': 'foo.bar.bang'}
|
||||
render = MockRender()
|
||||
|
@ -227,5 +225,5 @@ class WrapRenderTestCase(TestCase):
|
|||
context=context,
|
||||
tmplpath='/tmp/foo/bar/bang.sls'
|
||||
)
|
||||
assert render.context['slspath'] == 'foo/bar'
|
||||
assert render.context['tpldir'] == 'foo/bar'
|
||||
assert render.context['slspath'] == 'foo/bar'
|
||||
assert render.context['tpldir'] == 'foo/bar'
|
||||
|
|
Loading…
Add table
Reference in a new issue