Esempio n. 1
0
 def test_2RE_true(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     chassis(self.dev, self.facts)
     self.assertTrue(self.facts['2RE'])
Esempio n. 2
0
 def test_chassis_exception_RuntimeError(self):
     xmldata = etree.XML('<rpc-reply><error>test</error></rpc-reply>')
     self.dev.rpc.get_chassis_inventory = MagicMock(side_effect=xmldata)
     chassis(self.dev, self.facts)
     self.assertFalse(self.facts['2RE'])
     self.assertEqual(self.facts['model'], self.facts['serialnumber'])
Esempio n. 3
0
 def test_chassis_exception_RuntimeError(self):
     xmldata = etree.XML('<rpc-reply><error>test</error></rpc-reply>')
     self.dev.rpc.get_chassis_inventory = MagicMock(side_effect=xmldata)
     chassis(self.dev, self.facts)
     self.assertFalse(self.facts['2RE'])
     self.assertEqual(self.facts['model'], self.facts['serialnumber'])
Esempio n. 4
0
 def test_2RE_true(self, mock_execute):
     mock_execute.side_effect = self._mock_manager
     chassis(self.dev, self.facts)
     self.assertTrue(self.facts['2RE'])