Ejemplo n.º 1
0
 def testCommandoResultsBad(self):
     commands = ["show run | in cisco"]
     commando = Commando(devices=[self.device.nodeName])
     data = commando.parse_template(results=[no_template_data], device=self.device, commands=commands)
     self.assertTrue(len(data) > 0)
     self.assertTrue(isinstance(data, list))
     self.assertTrue(isinstance(data[0], str))
     self.assertEquals(commando.parsed_results, {})
Ejemplo n.º 2
0
 def testCommandoResultsGood(self):
     commands = ["show version"]
     commando = Commando(devices=[self.device.nodeName])
     data = commando.parse_template(results=[big_cli_data], device=self.device, commands=commands)
     self.assertTrue(len(data) > 0)
     self.assertTrue(isinstance(data, list))
     self.assertTrue(isinstance(data[0], str))
     self.assertTrue(isinstance(commando.parsed_results, dict))
     self.assertEquals(commando.parsed_results.popitem()[1]["show version"]["hardware"], ['CSR1000V'])
Ejemplo n.º 3
0
 def testCommandoResultsBad(self):
     commands = ["show run | in cisco"]
     commando = Commando(devices=[self.device.nodeName])
     data = commando.parse_template(results=[no_template_data],
                                    device=self.device,
                                    commands=commands)
     self.assertTrue(len(data) > 0)
     self.assertTrue(isinstance(data, list))
     self.assertTrue(isinstance(data[0], str))
     self.assertEquals(commando.parsed_results, {})
Ejemplo n.º 4
0
 def testCommandoResultsGood(self):
     commands = ["show version"]
     commando = Commando(devices=[self.device.nodeName])
     data = commando.parse_template(results=[big_cli_data],
                                    device=self.device,
                                    commands=commands)
     self.assertTrue(len(data) > 0)
     self.assertTrue(isinstance(data, list))
     self.assertTrue(isinstance(data[0], str))
     self.assertTrue(isinstance(commando.parsed_results, dict))
     self.assertEquals(
         commando.parsed_results.popitem()[1]["show version"]["hardware"],
         ['CSR1000V'])