Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@mock.patch.object(tools, 'system_encoding', "cp1252")
def test_cp1252_encoding(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())
@mock.patch.object(tools, 'system_encoding', "cp1252")
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())