"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/unit/modules/test_debian_ip.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_debian_ip.py  (salt-2019.2.0):test_debian_ip.py  (salt-2019.2.1)
skipping to change at line 478 skipping to change at line 478
def test_get_network_settings(self): def test_get_network_settings(self):
''' '''
Test if it return the contents of the global network script. Test if it return the contents of the global network script.
''' '''
with patch.dict(debian_ip.__grains__, {'osfullname': 'Ubuntu', with patch.dict(debian_ip.__grains__, {'osfullname': 'Ubuntu',
'osrelease': '14'}), \ 'osrelease': '14'}), \
patch('salt.modules.debian_ip._parse_hostname', patch('salt.modules.debian_ip._parse_hostname',
MagicMock(return_value='SaltStack')), \ MagicMock(return_value='SaltStack')), \
patch('salt.modules.debian_ip._parse_domainname', patch('salt.modules.debian_ip._parse_domainname',
MagicMock(return_value='saltstack.com')): MagicMock(return_value='saltstack.com')), \
patch('salt.modules.debian_ip._parse_searc
hdomain',
MagicMock(return_value='test.salts
tack.com')):
mock_avai = MagicMock(return_value=True) mock_avai = MagicMock(return_value=True)
with patch.dict(debian_ip.__salt__, {'service.available': mock_avai, with patch.dict(debian_ip.__salt__, {'service.available': mock_avai,
'service.status': mock_avai}): 'service.status': mock_avai}):
self.assertEqual(debian_ip.get_network_settings(), self.assertEqual(debian_ip.get_network_settings(),
['NETWORKING=yes\n', [u'NETWORKING=yes\n',
'HOSTNAME=SaltStack\n', u'HOSTNAME=SaltStack\n',
'DOMAIN=saltstack.com\n']) u'DOMAIN=saltstack.com\n',
u'SEARCH=test.saltstack.com\n'])
mock = MagicMock(side_effect=jinja2.exceptions.TemplateNotFound mock = MagicMock(side_effect=jinja2.exceptions.TemplateNotFound
('error')) ('error'))
with patch.object(jinja2.Environment, 'get_template', mock): with patch.object(jinja2.Environment, 'get_template', mock):
self.assertEqual(debian_ip.get_network_settings(), '') self.assertEqual(debian_ip.get_network_settings(), '')
# 'get_routes' function tests: 1 # 'get_routes' function tests: 1
def test_get_routes(self): def test_get_routes(self):
''' '''
 End of changes. 2 change blocks. 
4 lines changed or deleted 9 lines changed or added

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