Пример #1
0
 def test_plain_resources_parsed_also(self):
     stub_executor = CliExecutor()
     stub_executor.get_full_status_xml = MagicMock(
         side_effect=[XML_PLAIN_RESOURCES])
     connector = CliConnector(executor=stub_executor)
     resources = connector.get_resources()
     self.assertEqual(3, len(resources))
     self.assertEqual(['c-259.stonith', 'c-260.stonith', 'MyResource'],
                      [x.id for x in resources])
Пример #2
0
 def test_get_resources_works(self):
     stub_executor = CliExecutor()
     stub_executor.get_full_status_xml = MagicMock(side_effect=[GOOD_XML])
     connector = CliConnector(executor=stub_executor)
     resources = connector.get_resources()
     self.assertEqual(6, len(resources))