mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Patch salt.utils.which for test_route test
This commit is contained in:
parent
51f7e107dc
commit
d2076a6c93
@ -335,12 +335,13 @@ class NetworkTestCase(TestCase):
|
||||
self.assertRaises(CommandExecutionError, network.routes, 'inet')
|
||||
|
||||
with patch.dict(network.__grains__, {'kernel': 'Linux'}):
|
||||
with patch.object(network, '_netstat_route_linux',
|
||||
side_effect=['A', [{'addr_family': 'inet'}]]):
|
||||
self.assertEqual(network.routes(None), 'A')
|
||||
with patch.object(salt.utils, 'which', return_value=True):
|
||||
with patch.object(network, '_netstat_route_linux',
|
||||
side_effect=['A', [{'addr_family': 'inet'}]]):
|
||||
self.assertEqual(network.routes(None), 'A')
|
||||
|
||||
self.assertListEqual(network.routes('inet'),
|
||||
[{'addr_family': 'inet'}])
|
||||
self.assertListEqual(network.routes('inet'),
|
||||
[{'addr_family': 'inet'}])
|
||||
|
||||
def test_default_route(self):
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user