Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_linux(self):
ifcfg.distro = 'Linux'
ifcfg.Parser = LinuxParser
parser = ifcfg.get_parser(ifconfig=ifconfig_out.LINUX)
interfaces = parser.interfaces
self.assertEqual(len(interfaces.keys()), 2)
eq_(interfaces['eth0']['ether'], '1a:2b:3c:4d:5e:6f')
eq_(interfaces['eth0']['inet'], '192.168.0.1')
eq_(interfaces['eth0']['broadcast'], '192.168.0.255')
eq_(interfaces['eth0']['netmask'], '255.255.255.0')
def test_ifcfg(self):
ifcfg.distro = 'Linux'
ifcfg.Parser = LinuxParser
interfaces = ifcfg.interfaces(ifconfig=ifconfig_out.LINUX)
res = len(interfaces) > 0
ok_(res)