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_interfaces(self):
ifcfg.Parser = WindowsParser
interfaces = ifcfg.interfaces(ifconfig=ipconfig_out.WINDOWS_10_ETH)
res = len(interfaces) > 0
ok_(res)
def test_cp1252_non_utf8_byte(self):
"""
Tests that things are still working when using this bizarre encoding
"""
ifcfg.distro = "Windows"
ifcfg.Parser = ifcfg.get_parser_class()
self.assertTrue(issubclass(ifcfg.Parser, WindowsParser))
parser = ifcfg.get_parser()
interfaces = parser.interfaces
self.assertIn("Ethernet adapter Local Area Connection 2", interfaces.keys())
self.assertIn("Tunnel adapter isatap.lan", interfaces.keys())
self.assertIn("Tunnel adapter Teredo Tunneling Pseudo-Interface", interfaces.keys())
self.assertEqual(len(interfaces.keys()), 3)
eq_(interfaces['Ethernet adapter Local Area Connection 2']['inet'], '10.0.2.15')
self.assertEqual(
len(interfaces['Ethernet adapter Local Area Connection 2']['inet6']),
0
)