Fix linter warts

This commit is contained in:
Daniel A. Wozniak 2020-03-10 01:45:48 +00:00
parent fd702bdd44
commit 9fa9dab8b2
No known key found for this signature in database
GPG key ID: 166B9D2C06C82D61

View file

@ -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'