mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Patch salt.utils.which for test_route test
This commit is contained in:
parent
51f7e107dc
commit
d2076a6c93
1 changed files with 6 additions and 5 deletions
|
@ -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…
Add table
Reference in a new issue