Patch salt.utils.which for test_netstat test

This commit is contained in:
Ch3LL 2017-06-21 10:50:03 -04:00
parent 29b0acc3a2
commit 51f7e107dc

View file

@ -91,8 +91,9 @@ class NetworkTestCase(TestCase):
Test for return information on open ports and states
'''
with patch.dict(network.__grains__, {'kernel': 'Linux'}):
with patch.object(network, '_netstat_linux', return_value='A'):
self.assertEqual(network.netstat(), 'A')
with patch.object(salt.utils, 'which', return_value=True):
with patch.object(network, '_netstat_linux', return_value='A'):
self.assertEqual(network.netstat(), 'A')
with patch.dict(network.__grains__, {'kernel': 'OpenBSD'}):
with patch.object(network, '_netstat_bsd', return_value='A'):