def test_hw_addr(self): ''' Test for return the hardware address (a.k.a. MAC address) for a given interface ''' with patch.object(salt.utils.network, 'hw_addr', return_value={}): self.assertDictEqual(network.hw_addr('iface'), {})
def test_hw_addr(self): """ Test for return the hardware address (a.k.a. MAC address) for a given interface """ with patch.object(salt.utils.network, "hw_addr", return_value={}): self.assertDictEqual(network.hw_addr("iface"), {})
def test_hw_addr(self): """ Test for return the hardware address (a.k.a. MAC address) for a given interface """ with patch.dict(network.__utils__, {"network.hw_addr": MagicMock(return_value={})}): self.assertDictEqual(network.hw_addr("iface"), {})
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}