Exemple #1
0
 def setUp(self):
     logging.basicConfig(
         level=logging.NOTSET,
         format=
         '%(asctime)s %(levelname)s %(name)s pid(%(process)d) Message: %(message)s',
         filename='/tmp/imagefactory-unittests.log')
     self.template = Template("<template></template>")
     self.target = "mock"
     self.builder = MockBuilder(self.template, self.target)
Exemple #2
0
 def testTemplateFramImageID(self):
     template_id = self.warehouse.store_template(self.template_xml)
     template = Template(template_id)
     target = "mock"
     builder = MockBuilder(self.template_xml, target)
     builder.build_image()
     metadata = dict(template=template_id,
                     target=target,
                     icicle="None",
                     target_parameters="None")
     self.warehouse.store_target_image(builder.new_image_id,
                                       builder.image,
                                       metadata=metadata)
     image_template = Template(builder.new_image_id)
     self.assertEqual(template_id, image_template.identifier)
     self.assertEqual(self.template_xml, image_template.xml)
     self.assertIsNone(template.url)