Example #1
0
 def on_head(self, req, resp, tenant_id, schedule_id):
     schedule = Schedule.get_schedule(tenant_id, schedule_id)
     if schedule:
         for entry in schedule.entries:
             execute_job.apply_async((entry.job_id, ),
                                     countdown=entry.get_total_seconds())
         resp.status = falcon.HTTP_200
     else:
         self._not_found(resp, schedule_id)
Example #2
0
 def on_head(self, req, resp, tenant_id, schedule_id):
     schedule = Schedule.get_schedule(tenant_id, schedule_id)
     if schedule:
         for entry in schedule.entries:
             execute_job.apply_async((entry.job_id,),
                                     countdown=entry.get_total_seconds())
         resp.status = falcon.HTTP_200
     else:
         self._not_found(resp, schedule_id)
Example #3
0
 def on_get(self, req, resp, tenant_id, schedule_id):
     schedule = Schedule.get_schedule(tenant_id, schedule_id)
     if schedule:
         resp.body = self.format_response_body(schedule.as_dict())
     else:
         self._not_found(resp, schedule_id)
Example #4
0
 def can_delete(self):
     Schedule.delete_schedule(self.schedule.schedule_id)
     found = Schedule.get_schedule(self.tenant_id,
                                   self.schedule.schedule_id)
     expect(found).to.be_none()
Example #5
0
 def on_get(self, req, resp, tenant_id, schedule_id):
     schedule = Schedule.get_schedule(tenant_id, schedule_id)
     if schedule:
         resp.body = self.format_response_body(schedule.as_dict())
     else:
         self._not_found(resp, schedule_id)
Example #6
0
 def should_fail_to_get_missing_schedule(self):
     found = Schedule.get_schedule(self.tenant_id, str(uuid.uuid4()))
     expect(found).to.be_none()
Example #7
0
 def can_save_and_get_a_schedule(self):
     found = Schedule.get_schedule(self.tenant_id,
                                   self.schedule.schedule_id)
     expect(found.as_dict()).to.equal(example_schedule_dict)
Example #8
0
 def can_delete(self):
     Schedule.delete_schedule(self.schedule.schedule_id)
     found = Schedule.get_schedule(
         self.tenant_id, self.schedule.schedule_id)
     expect(found).to.be_none()
Example #9
0
 def should_fail_to_get_missing_schedule(self):
     found = Schedule.get_schedule(self.tenant_id, str(uuid.uuid4()))
     expect(found).to.be_none()
Example #10
0
 def can_save_and_get_a_schedule(self):
     found = Schedule.get_schedule(
         self.tenant_id, self.schedule.schedule_id)
     expect(found.as_dict()).to.equal(example_schedule_dict)