mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add tests for file.source_list with local files
This commit is contained in:
parent
4f8e2a30fe
commit
d175061c5d
1 changed files with 31 additions and 0 deletions
|
@ -217,6 +217,37 @@ class FileModuleTest(integration.ModuleCase):
|
|||
self.assertItemsEqual(ret, ['http://t.est.com/http/httpd.conf',
|
||||
'filehash'])
|
||||
|
||||
def test_source_list_for_single_local_file_slash_returns_unchanged(self):
|
||||
ret = self.run_function('file.source_list', [self.myfile,
|
||||
'filehash', 'base'])
|
||||
self.assertItemsEqual(ret, [self.myfile, 'filehash'])
|
||||
|
||||
def test_source_list_for_single_local_file_proto_returns_unchanged(self):
|
||||
ret = self.run_function('file.source_list', ['file://' + self.myfile,
|
||||
'filehash', 'base'])
|
||||
self.assertItemsEqual(ret, ['file://' + self.myfile, 'filehash'])
|
||||
|
||||
def test_source_list_for_list_returns_existing_local_file_slash(self):
|
||||
ret = filemod.source_list([self.myfile + '-foo',
|
||||
self.myfile],
|
||||
'filehash', 'base')
|
||||
self.assertItemsEqual(ret, [self.myfile, 'filehash'])
|
||||
|
||||
def test_source_list_for_list_returns_existing_local_file_proto(self):
|
||||
ret = filemod.source_list(['file://' + self.myfile + '-foo',
|
||||
'file://' + self.myfile],
|
||||
'filehash', 'base')
|
||||
self.assertItemsEqual(ret, ['file://' + self.myfile, 'filehash'])
|
||||
|
||||
def test_source_list_for_list_returns_local_file_slash_from_dict(self):
|
||||
ret = filemod.source_list(
|
||||
[{self.myfile: ''}], 'filehash', 'base')
|
||||
self.assertItemsEqual(ret, [self.myfile, 'filehash'])
|
||||
|
||||
def test_source_list_for_list_returns_local_file_proto_from_dict(self):
|
||||
ret = filemod.source_list(
|
||||
[{'file://' + self.myfile: ''}], 'filehash', 'base')
|
||||
self.assertItemsEqual(ret, ['file://' + self.myfile, 'filehash'])
|
||||
|
||||
if __name__ == '__main__':
|
||||
from integration import run_tests
|
||||
|
|
Loading…
Add table
Reference in a new issue