예제 #1
0
    def setUp(self):
        super(TestLanguagePack, self).setUp()
        self.db = self.useFixture(utils.Database())
        self.ctx = utils.dummy_context()

        attr_dict = {}
        attr_dict["runtime_versions"] = ["1.6", "1.7"]
        attr_dict["build_tool_chain"] = [{
            "type": "ant",
            "version": "1.7"
        }, {
            "type": "maven",
            "version": "1.2"
        }]
        attr_dict["attributes"] = {
            "optional_attr1": "value",
            "admin_email": "*****@*****.**"
        }

        self.data = [{
            'project_id': 'test_id',
            'user_id': 'fred',
            'uuid': '123456789abcdefghi',
            'name': 'languagepack1',
            'description': 'test language pack',
            'attr_blob': attr_dict,
            'service_id': 1234
        }]

        utils.create_models_from_data(lp.LanguagePack, self.data, self.ctx)
예제 #2
0
    def setUp(self):
        super(TestExecution, self).setUp()
        self.db = self.useFixture(utils.Database())
        self.ctx = utils.dummy_context()

        self.data = [{'pipeline_id': 'bla',
                      'uuid': 'ce43e347f0b0422825245b3e5f140a81cef6e65b'}]
        utils.create_models_from_data(execution.Execution, self.data, self.ctx)
예제 #3
0
 def setUp(self):
     super(TestImage, self).setUp()
     self.db = self.useFixture(utils.Database())
     self.ctx = utils.dummy_context()
     self.data = [{
         'project_id': 'test_id',
         'user_id': 'fred',
         'uuid': '12345678abcdefgh',
         'name': 'image1',
         'description': 'test image'
     }]
     utils.create_models_from_data(image.Image, self.data, self.ctx)
예제 #4
0
    def setUp(self):
        super(TestCompilerVersions, self).setUp()
        self.db = self.useFixture(utils.Database())
        self.ctx = utils.dummy_context()

        self.data = [{
            'uuid': '123456789abcdefghi',
            'version': '1.4',
            'language_pack_id': 'java1.4'
        }]

        utils.create_models_from_data(lp.CompilerVersions, self.data, self.ctx)
예제 #5
0
 def setUp(self):
     super(TestImage, self).setUp()
     self.db = self.useFixture(utils.Database())
     self.ctx = utils.dummy_context()
     self.data = [{
         'project_id': self.ctx.tenant,
         'user_id': 'fred',
         'uuid': '25f7fa50-b980-4452-a550-dea5fd98ffc2',
         'name': 'image1',
         'description': 'test image'
     }]
     utils.create_models_from_data(image.Image, self.data, self.ctx)
예제 #6
0
    def setUp(self):
        super(TestPlan, self).setUp()
        self.db = self.useFixture(utils.Database())
        self.ctx = utils.dummy_context()

        self.data = [{
            'uuid': 'test-uuid-123',
            'project_id': 'bla',
            'user_id': 'fred',
            'raw_content': 'lots of stuff here'
        }]
        utils.create_models_from_data(plan.Plan, self.data, self.ctx)
예제 #7
0
 def setUp(self):
     super(TestApp, self).setUp()
     self.db = self.useFixture(utils.Database())
     self.ctx = utils.dummy_context()
     self.data = [{
         'id': 'test-uuid-555',
         'project_id': self.ctx.tenant,
         'user_id': 'fred',
         'name': 'testapp',
         'description': 'fake app for testing',
     }]
     utils.create_models_from_data(app.App, self.data, self.ctx)
예제 #8
0
    def setUp(self):
        super(TestOSPlatform, self).setUp()
        self.db = self.useFixture(utils.Database())
        self.ctx = utils.dummy_context()

        self.data = [{
            'uuid': '123456789abcdefghi',
            'os': 'ubuntu',
            'version': '12.04',
            'language_pack_id': 'java1.4'
        }]

        utils.create_models_from_data(lp.OSPlatform, self.data, self.ctx)
예제 #9
0
 def setUp(self):
     super(TestService, self).setUp()
     self.db = self.useFixture(utils.Database())
     self.ctx = utils.dummy_context()
     self.data = [{
         'project_id': 'fake_project_id',
         'user_id': 'fred',
         'uuid': '12345678abcdefgh',
         'name': 'service1',
         'description': 'test service',
         'service_type': 'language_pack'
     }]
     utils.create_models_from_data(service.Service, self.data, self.ctx)
예제 #10
0
    def setUp(self):
        super(TestComponent, self).setUp()
        self.db = self.useFixture(utils.Database())
        self.ctx = utils.dummy_context()

        self.data = [{
            'project_id': 'project_id_blah',
            'user_id': 'fred',
            'uuid': 'ce43e347f0b0422825245b3e5f140a81cef6e65b',
            'name': 'component1',
            'description': 'test component',
            'tags': 'component tags'
        }]
        utils.create_models_from_data(component.Component, self.data, self.ctx)
예제 #11
0
    def setUp(self):
        super(TestPipeline, self).setUp()
        self.db = self.useFixture(utils.Database())
        self.ctx = utils.dummy_context()

        self.data = [{'project_id': self.ctx.tenant,
                      'uuid': 'ce43e347f0b0422825245b3e5f140a81cef6e65b',
                      'user_id': 'fred',
                      'name': 'pipeline1',
                      'description': 'test pipeline',
                      'trigger_id': 'trigger-uuid-1234',
                      'tags': 'pipeline tags',
                      'plan_id': 'plan_id_1'}]
        utils.create_models_from_data(pipeline.Pipeline, self.data, self.ctx)
예제 #12
0
    def setUp(self):
        super(TestAssembly, self).setUp()
        self.db = self.useFixture(utils.Database())
        self.ctx = utils.dummy_context()

        self.data = [{
            'project_id': 'project_id_blah',
            'uuid': 'ce43e347f0b0422825245b3e5f140a81cef6e65b',
            'user_id': 'fred',
            'name': 'assembly1',
            'description': 'test assembly',
            'tags': 'assembly tags',
            'plan_id': 'plan_id_1'
        }]
        utils.create_models_from_data(assembly.Assembly, self.data, self.ctx)
예제 #13
0
    def setUp(self):
        super(TestOperation, self).setUp()
        self.db = self.useFixture(utils.Database())
        self.ctx = utils.dummy_context()

        self.data = [{
            'project_id': 'bla',
            'user_id': 'fred',
            'uuid': 'ce43e347f0b0422825245b3e5f140a81cef6e65b',
            'name': 'o1',
            'description': 'Scale up the resource',
            'documentation': 'http://documentation.link',
            'target_resource': 'http://target.resource.link'
        }]
        utils.create_models_from_data(operation.Operation, self.data, self.ctx)
예제 #14
0
    def setUp(self):
        super(TestUserlog, self).setUp()
        self.db = self.useFixture(utils.Database())
        self.ctx = utils.dummy_context()
        a_id = uuid.uuid4()

        self.data = [{'id': 12,
                      'resource_uuid': '%s' % a_id,
                      'resource_type': 'app',
                      'strategy': 'local',
                      'location': '/dev/null',
                      'project_id': self.ctx.tenant,
                      'strategy_info': '{}',
                      }]
        utils.create_models_from_data(userlog.Userlog, self.data, self.ctx)
    def setUp(self):
        super(TestInfrastructureStack, self).setUp()
        self.db = self.useFixture(utils.Database())
        self.ctx = utils.dummy_context()

        self.data = [{'project_id': self.ctx.tenant,
                      'user_id': 'fred',
                      'uuid': 'ceda0408-c93d-4772-abb2-18f65189d440',
                      'name': 'o1',
                      'description': 'Scale up the resource',
                      'image_id': 'fake_image_id',
                      'heat_stack_id': 'fake_heat_stack_id'}]
        utils.create_models_from_data(infrastructure_stack.InfrastructureStack,
                                      self.data,
                                      self.ctx)
예제 #16
0
    def setUp(self):
        super(TestAssembly, self).setUp()
        self.db = self.useFixture(utils.Database())
        self.ctx = utils.dummy_context()

        self.data = [{
            'project_id': self.ctx.tenant,
            'uuid': 'ce43e347f0b0422825245b3e5f140a81cef6e65b',
            'user_id': 'fred',
            'name': 'assembly1',
            'description': 'test assembly',
            'tags': 'assembly tags',
            'plan_id': 'plan_id_1',
            'status': 'BUILDING',
            'application_uri': 'http://192.168.78.21:5000'
        }]
        utils.create_models_from_data(assembly.Assembly, self.data, self.ctx)
예제 #17
0
    def setUp(self):
        super(TestSensor, self).setUp()
        self.db = self.useFixture(utils.Database())
        self.ctx = utils.dummy_context()

        self.data = [{
            'uuid': 'test-uuid-34dsxD',
            'project_id': self.ctx.tenant,
            'user_id': '55f41cf46df74320b9486a35f5d28a11',
            'name': 'hb',
            'description': 'A heartbeat sensor',
            'documentation': 'http://example.com/docs/heartbeat/',
            'target_resource': 'http://example.com/instances/uuid',
            'sensor_type': 'str',
            'value': '30'
        }]
        utils.create_models_from_data(sensor.Sensor, self.data, self.ctx)
예제 #18
0
 def setUp(self):
     super(TestPlan, self).setUp()
     self.db = self.useFixture(utils.Database())
     self.ctx = utils.dummy_context()
     raw_content = {
         'artifacts': [{
             'content': {
                 'href': 'http://github.com/some/project'
             }
         }]
     }
     self.data = [{
         'uuid': 'test-uuid-123',
         'project_id': 'bla',
         'user_id': 'fred',
         'description': 'some description',
         'raw_content': raw_content
     }]
     utils.create_models_from_data(plan.Plan, self.data, self.ctx)
예제 #19
0
    def setUp(self):
        super(TestComponent, self).setUp()
        self.db = self.useFixture(utils.Database())
        self.ctx = utils.dummy_context()
        self.data_assembly = [{
            'project_id': self.ctx.tenant,
            'uuid': 'ce43e347f0b0422825245b3e5f140a81cef6e65b',
            'user_id': 'fred',
            'name': 'assembly1',
            'description': 'test assembly',
            'trigger_id': 'trigger-uuid-1234',
            'tags': 'assembly tags',
            'plan_id': 'plan_id_1',
            'status': 'Building',
            'application_uri': 'http://192.168.78.21:5000'
        }]
        utils.create_models_from_data(assembly.Assembly, self.data_assembly,
                                      self.ctx)

        self.data = [{
            'project_id': self.ctx.tenant,
            'user_id': 'fred',
            'uuid': 'ce43e347f0b0422825245b3e5f140a81cef6e65b',
            'name': 'component_no_assembly',
            'component_type': 'xyz',
            'description': 'test component',
            'parent_component_id': '87d98s',
            'tags': 'component tags',
            'heat_stack_id': '4c712026-dcd5-4664-90b8-0915494c1332'
        }, {
            'project_id': self.ctx.tenant,
            'user_id': 'fred',
            'uuid': '70763488-72e0-44ac-a612-e94bf5488555',
            'name': 'component_assembly',
            'component_type': 'xyz',
            'description': 'test component',
            'assembly_uuid': 'ce43e347f0b042282524'
            '5b3e5f140a81cef6e65b',
            'parent_component_id': '87d98s',
            'tags': 'component tags',
            'heat_stack_id': '4c712026-dcd5-4664-90b8-0915494c1332'
        }]
        utils.create_models_from_data(component.Component, self.data, self.ctx)
예제 #20
0
    def setUp(self):
        super(TestExtension, self).setUp()
        self.db = self.useFixture(utils.Database())
        self.ctx = utils.dummy_context()

        self.data = [{
            'uuid':
            'test-uuid-42',
            'project_id':
            self.ctx.tenant,
            'user_id':
            '55f41cf46df74320b9486a35f5d28a11',
            'name':
            'logstash',
            'version':
            '2.13',
            'description':
            'This logstash extension provides a tool'
            ' for managing your application events'
            ' and logs.',
            'documentation':
            'http://example.com/docs/ext/logstash',
        }]
        utils.create_models_from_data(extension.Extension, self.data, self.ctx)
예제 #21
0
 def setUp(self):
     super(TestNotifications, self).setUp()
     self.ctx = utils.dummy_context()
     self.db = self.useFixture(utils.Database())
예제 #22
0
 def setUp(self):
     super(TestTypes, self).setUp()
     self.useFixture(utils.Database())
예제 #23
0
 def setUp(self):
     super(TestWorkflow, self).setUp()
     self.db = self.useFixture(utils.Database())
     self.ctx = utils.dummy_context()
     self.data = [self._get_data(self.ctx.tenant)]
     utils.create_models_from_data(workflow.Workflow, self.data, self.ctx)
예제 #24
0
 def setUp(self):
     super(tests.BaseTestCase, self).setUp()
     self.ctx = utils.dummy_context()
     self.useFixture(utils.Database())