Beispiel #1
0
    "name": "name",
    "stationid": "stationid",
    "userid": "userid",
    "state": "state",
    "oaid": "oaid",
    "pay_status": "pay_status",
    "pay_interval": 1,
    "total_runtime": 10000,
    "archived": False,
    "status_history": [{
        "timestamp": TIMESTAMP,
        "status": "uploaded"
    }],
}

jobObject = job_dict_to_job(job)


def mocked_requests_get(*args, **kwargs):
    if args[0] == "{backend}{namespace}/job/upload_request".format(
            backend=BACKEND, namespace=NAMESPACE):
        return MockResponse({"location": LOCATION, "filename": FILENAME}, 200)
    elif args[
            0] == "{backend}{namespace}/jobs/{job_id}/results/location".format(
                backend=BACKEND, namespace=NAMESPACE, job_id=JOB_ID):
        return MockResponse({"location": LOCATION, "filename": FILENAME}, 200)
    elif args[0] == "{backend}{namespace}/jobs/{job_id}/results".format(
            backend=BACKEND, namespace=NAMESPACE, job_id=JOB_ID):
        return MockResponse(
            {"files": [{
                "path": LOCATION,
Beispiel #2
0
 def on_station_job_updated(data):
     self.jobs_events.station_job_updated(
         StationJobUpdatedEvent(job_dict_to_job(data["job"])))
Beispiel #3
0
 def on_job_launcher_submitted(data):
     self.jobs_events.job_launcher_submitted(
         JobLauncherSubmittedEvent(job_dict_to_job(data["job"])))
Beispiel #4
0
 def on_job_launcher_updated(data):
     self.jobs_events.job_launcher_updated(
         JobLauncherUpdatedEvent(job_dict_to_job(data["job"])))