Beispiel #1
0
    def build_job_from_dict(cls, job_dict):
        actions = []
        for action in job_dict.get("actions", []):
            actions.append(Action.build_action_from_dict(action))

        kwargs = {
            'tenant_id': job_dict.get("tenant_id"),
            'job_id': job_dict.get("id", str(uuid.uuid4())),
            'name': job_dict.get("name"),
            'actions': actions
        }

        return Job(**kwargs)
Beispiel #2
0
    def build_job_from_dict(cls, job_dict):
        actions = []
        for action in job_dict.get("actions", []):
            actions.append(Action.build_action_from_dict(action))

        kwargs = {
            'tenant_id': job_dict.get("tenant_id"),
            'job_id': job_dict.get("id", str(uuid.uuid4())),
            'name': job_dict.get("name"),
            'actions': actions,
            'run_numbers': job_dict.get("run_numbers")
        }

        return Job(**kwargs)
Beispiel #3
0
        def can_deserialize_from_a_dictionary(self):
            action = Action.build_action_from_dict(self.example)

            expect(action.action_type).to.equal(self.example['type'])
            expect(action.targets[0]).to.equal(self.example['targets'][0])
Beispiel #4
0
        def can_deserialize_from_a_dictionary(self):
            action = Action.build_action_from_dict(self.example)

            expect(action.action_type).to.equal(self.example['type'])
            expect(action.targets[0]).to.equal(self.example['targets'][0])