Example #1
0
 def test_interface_switchport_port_security(self):
     with fake_filesystem_unittest.Patcher() as patcher:
         patcher.fs.create_file(
             '/mock',
             contents=test_interface_switchport_port_security["input"])
         self.assertEqual(convert_to_yaml(CiscoConfParse('/mock')),
                          test_interface_switchport_port_security["output"])
Example #2
0
 def test_firwall_1(self):
     lines = test_firewall_1["input"].split("\n")
     self.assertEqual(test_firewall_1["output"],
                      convert_to_yaml(uci.UciFile.from_lines(lines)))
Example #3
0
 def test_beardropper(self):
     lines = test_beardropper["input"].split("\n")
     self.assertEqual(test_beardropper["output"],
                      convert_to_yaml(uci.UciFile.from_lines(lines)))
Example #4
0
 def test_interface_name_identification(self):
     with fake_filesystem_unittest.Patcher() as patcher:
         patcher.fs.create_file(
             '/mock', contents=test_interface_name_identification["input"])
         self.assertEqual(convert_to_yaml(CiscoConfParse('/mock')),
                          test_interface_name_identification["output"])
Example #5
0
 def test_interface_power_inline_police(self):
     with fake_filesystem_unittest.Patcher() as patcher:
         patcher.fs.create_file(
             '/mock', contents=test_interface_power_inline_police["input"])
         self.assertEqual(convert_to_yaml(CiscoConfParse('/mock')),
                          test_interface_power_inline_police["output"])