"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/unit/states/test_boto_cloudfront.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_boto_cloudfront.py  (salt-2019.2.0):test_boto_cloudfront.py  (salt-2019.2.1)
skipping to change at line 93 skipping to change at line 93
with patch.multiple(boto_cloudfront, with patch.multiple(boto_cloudfront,
__salt__={'boto_cloudfront.get_distribution': mock_get}, __salt__={'boto_cloudfront.get_distribution': mock_get},
__opts__={'test': True}, __opts__={'test': True},
): ):
comment = 'Distribution {0} set for creation.'.format(self.name) comment = 'Distribution {0} set for creation.'.format(self.name)
self.assertDictEqual( self.assertDictEqual(
boto_cloudfront.present(self.name, self.config, self.tags), boto_cloudfront.present(self.name, self.config, self.tags),
self.base_ret_with({ self.base_ret_with({
'result': None, 'result': None,
'comment': comment, 'comment': comment,
'pchanges': {'old': None, 'new': self.name}, 'changes': {'old': None, 'new': self.name},
}), }),
) )
mock_create_failure = MagicMock(return_value={'error': 'create error'}) mock_create_failure = MagicMock(return_value={'error': 'create error'})
with patch.multiple(boto_cloudfront, with patch.multiple(boto_cloudfront,
__salt__={ __salt__={
'boto_cloudfront.get_distribution': mock_get, 'boto_cloudfront.get_distribution': mock_get,
'boto_cloudfront.create_distribution': mock_create_failure, 'boto_cloudfront.create_distribution': mock_create_failure,
}, },
__opts__={'test': False}, __opts__={'test': False},
skipping to change at line 193 skipping to change at line 193
with patch.multiple(boto_cloudfront, with patch.multiple(boto_cloudfront,
__salt__={'boto_cloudfront.get_distribution': mock_get}, __salt__={'boto_cloudfront.get_distribution': mock_get},
__opts__={'test': True}, __opts__={'test': True},
): ):
header = 'Distribution {0} set for new config:'.format(self.name) header = 'Distribution {0} set for new config:'.format(self.name)
self.assertDictEqual( self.assertDictEqual(
boto_cloudfront.present(self.name, self.config, self.tags), boto_cloudfront.present(self.name, self.config, self.tags),
self.base_ret_with({ self.base_ret_with({
'result': None, 'result': None,
'comment': '\n'.join([header, diff]), 'comment': '\n'.join([header, diff]),
'pchanges': {'diff': diff}, 'changes': {'diff': diff},
}), }),
) )
mock_update_failure = MagicMock(return_value={'error': 'update error'}) mock_update_failure = MagicMock(return_value={'error': 'update error'})
with patch.multiple(boto_cloudfront, with patch.multiple(boto_cloudfront,
__salt__={ __salt__={
'boto_cloudfront.get_distribution': mock_get, 'boto_cloudfront.get_distribution': mock_get,
'boto_cloudfront.update_distribution': mock_update_failure, 'boto_cloudfront.update_distribution': mock_update_failure,
}, },
__opts__={'test': False}, __opts__={'test': False},
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

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