mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Fixed integration test
This commit is contained in:
parent
49fb321254
commit
721bce0a11
@ -86,12 +86,12 @@ def get_file(path, dest, env='base', template=None):
|
||||
try:
|
||||
path = _render(path)
|
||||
except CommandExecutionError as exc:
|
||||
log.error(exc.message)
|
||||
log.error(str(exc))
|
||||
return ''
|
||||
try:
|
||||
dest = _render(dest)
|
||||
except CommandExecutionError as exc:
|
||||
log.error(exc.message)
|
||||
log.error(str(exc))
|
||||
return ''
|
||||
|
||||
if not hash_file(path, env):
|
||||
|
1
tests/integration/files/file/base/cheese
Normal file
1
tests/integration/files/file/base/cheese
Normal file
@ -0,0 +1 @@
|
||||
I could just fancy some cheese, Gromit. What do you say? Cheddar?
|
@ -24,7 +24,7 @@ class CPModuleTest(integration.ModuleCase):
|
||||
self.assertIn('KNIGHT: They\'re nervous, sire.', data)
|
||||
self.assertNotIn('bacon', data)
|
||||
|
||||
def text_get_file_templated_paths(self):
|
||||
def test_get_file_templated_paths(self):
|
||||
'''
|
||||
cp.get_file
|
||||
'''
|
||||
@ -32,9 +32,11 @@ class CPModuleTest(integration.ModuleCase):
|
||||
self.run_function(
|
||||
'cp.get_file',
|
||||
[
|
||||
'salt://{{grain.test_grain}}',
|
||||
tgt.replace('cheese', '{{grain.test_grain}}'),
|
||||
])
|
||||
'salt://{{grains.test_grain}}',
|
||||
tgt.replace('cheese', '{{grains.test_grain}}')
|
||||
],
|
||||
template='jinja'
|
||||
)
|
||||
with open(tgt, 'r') as cheese:
|
||||
data = cheese.read()
|
||||
self.assertIn('Gromit', data)
|
||||
|
Loading…
Reference in New Issue
Block a user