"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/unit/states/test_elasticsearch.py" between
salt-2019.2.0.tar.gz and salt-2019.2.1.tar.gz

About: SaltStack is a systems management software for data center automation, cloud orchestration, server provisioning, configuration management and more. Community version.

test_elasticsearch.py  (salt-2019.2.0):test_elasticsearch.py  (salt-2019.2.1)
skipping to change at line 280 skipping to change at line 280
ret.update({'comment': '', 'result': False, 'changes': {}}) ret.update({'comment': '', 'result': False, 'changes': {}})
self.assertDictEqual(elasticsearch.index_template_present(name, {}), ret) self.assertDictEqual(elasticsearch.index_template_present(name, {}), ret)
ret.update({'comment': '', 'result': False, 'changes': {}}) ret.update({'comment': '', 'result': False, 'changes': {}})
self.assertDictEqual(elasticsearch.index_template_present(name, {}), ret) self.assertDictEqual(elasticsearch.index_template_present(name, {}), ret)
ret.update({'comment': '', 'result': False, 'changes': {}}) ret.update({'comment': '', 'result': False, 'changes': {}})
self.assertDictEqual(elasticsearch.index_template_present(name, {}), ret) self.assertDictEqual(elasticsearch.index_template_present(name, {}), ret)
def test_index_template_present_check_definition(self):
'''
Test to manage a elasticsearch index template.
with check_definition set
'''
name = 'foo'
index_template = {name: {"test2": "key",
"aliases": {},
"mappings": {},
"settings": {}}}
expected = {'name': name,
'result': True,
'comment': 'Index template foo is already present and up to
date',
'changes': {}}
mock_exists = MagicMock(side_effect=[True])
mock_create = MagicMock(side_effect=[True])
mock_get = MagicMock(side_effect=[index_template])
with patch.dict(elasticsearch.__salt__, {'elasticsearch.index_template_g
et': mock_get,
'elasticsearch.index_template_creat
e': mock_create,
'elasticsearch.index_template_exist
s': mock_exists}):
ret = elasticsearch.index_template_present(name,
{"test2": "key",
"aliases": {}},
check_definition=True)
self.assertDictEqual(expected, ret)
def test_index_template_present_check_definition_alias_not_empty(self):
'''
Test to manage a elasticsearch index template.
with check_definition set and alias is not empty
'''
name = 'foo'
index_template = {name: {"test2": "key",
"aliases": {},
"mappings": {},
"settings": {}}}
expected = {'name': name,
'result': True,
'comment': 'Successfully updated index template foo',
'changes': {'new': {'aliases': {'alias1': {}}}, 'old': {'ali
ases': {}}}}
mock_exists = MagicMock(side_effect=[True])
mock_create = MagicMock(side_effect=[True])
mock_get = MagicMock(side_effect=[index_template])
with patch.dict(elasticsearch.__salt__, {'elasticsearch.index_template_g
et': mock_get,
'elasticsearch.index_template_creat
e': mock_create,
'elasticsearch.index_template_exist
s': mock_exists}):
ret = elasticsearch.index_template_present(name,
{"test2": "key",
"aliases": {'alias1': {}}
},
check_definition=True)
self.assertDictEqual(expected, ret)
# 'pipeline_absent' function tests: 1 # 'pipeline_absent' function tests: 1
def test_pipeline_absent(self): def test_pipeline_absent(self):
''' '''
Test to manage a elasticsearch pipeline. Test to manage a elasticsearch pipeline.
''' '''
name = 'foo' name = 'foo'
pipeline = {name: {"test": "key"}} pipeline = {name: {"test": "key"}}
 End of changes. 1 change blocks. 
0 lines changed or deleted 71 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)