def test_interfaces(self): ''' Test for return a dictionary of information about all the interfaces on the minion ''' with patch.object(salt.utils.network, 'interfaces', return_value={}): self.assertDictEqual(network.interfaces(), {})
def test_interfaces(self): """ Test for return a dictionary of information about all the interfaces on the minion """ with patch.dict(network.__utils__, {"network.interfaces": MagicMock(return_value={})}): self.assertDictEqual(network.interfaces(), {})
def lb_iptables(): hw_addrs=[] for i in salt_network.interfaces().keys(): if i.startswith('eth'): hw_addrs.append(salt_network.hw_addr(i)) return {'hw_addrs':hw_addrs}