Esempio n. 1
0
 def setUp(self):
     super(TestActionsResource, self).setUp()
     self.mock_db = mock.Mock()
     self.mock_req = mock.MagicMock()
     self.mock_req.__getitem__.side_effect = common.get_req_items
     self.mock_req.get_header.return_value = common.fake_action_0['user_id']
     self.mock_req.status = falcon.HTTP_200
     self.resource = v1_actions.ActionsResource(self.mock_db)
     self.mock_json_body = mock.Mock()
     self.mock_json_body.return_value = {}
     self.resource.json_body = self.mock_json_body
Esempio n. 2
0
def public_endpoints(storage_driver):
    return [
        ('/',
         homedoc.Resource()),

        ('/backups',
         backups.BackupsCollectionResource(storage_driver)),

        ('/backups/{backup_id}',
         backups.BackupsResource(storage_driver)),

        ('/clients',
         clients.ClientsCollectionResource(storage_driver)),

        ('/clients/{client_id}',
         clients.ClientsResource(storage_driver)),

        ('/jobs',
         jobs.JobsCollectionResource(storage_driver)),

        ('/jobs/{job_id}',
         jobs.JobsResource(storage_driver)),

        ('/jobs/{job_id}/event',
         jobs.JobsEvent(storage_driver)),

        ('/actions',
         actions.ActionsCollectionResource(storage_driver)),

        ('/actions/{action_id}',
         actions.ActionsResource(storage_driver)),

        ('/sessions',
         sessions.SessionsCollectionResource(storage_driver)),

        ('/sessions/{session_id}',
         sessions.SessionsResource(storage_driver)),

        ('/sessions/{session_id}/action',
         sessions.SessionsAction(storage_driver)),

        ('/sessions/{session_id}/jobs/{job_id}',
         sessions.SessionsJob(storage_driver)),

    ]