Exemple #1
0
 def test_get_specific_jobs_no_match(self):
     results = interface.get_specific_jobs(self.credential, [])
     expected = {
         'cluster': CLUSTER["name"],
         'failed': [],
         'worked': [],
         'error': None
     }
     self.assertEqual(results, expected)
Exemple #2
0
 def test_get_specific_jobs_no_match(self):
     results = interface.get_specific_jobs(self.credential, [])
     expected = {
         'cluster': CLUSTER["name"],
         'failed': [],
         'worked': [],
         'error': None
     }
     self.assertEqual(results, expected)
Exemple #3
0
def job_detail(request, cluster, jobid):
    credential = Credential.objects.get(
        user=request.user, cluster__name=cluster)
    results = interface.get_specific_jobs(credential, [jobid])
    if results["error"]:
        e = results["error"]
        job = None
    elif results["failed"]:
        e = results["failed"][0][1]
        job = None
    else:
        job = results["worked"][0][1]
        e = None
    c = {
        "job": job,
        "cluster": cluster,
        "error_message": e,
    }
    return render(request, "cluster/job_detail.html", c)
Exemple #4
0
def job_detail(request, cluster, jobid):
    credential = Credential.objects.get(user=request.user,
                                        cluster__name=cluster)
    results = interface.get_specific_jobs(credential, [jobid])
    if results["error"]:
        e = results["error"]
        job = None
    elif results["failed"]:
        e = results["failed"][0][1]
        job = None
    else:
        job = results["worked"][0][1]
        e = None
    c = {
        "job": job,
        "cluster": cluster,
        "error_message": e,
    }
    return render(request, "cluster/job_detail.html", c)
Exemple #5
0
 def test_get_specific_jobs_invalid_credential(self):
     results = interface.get_specific_jobs(None, [])
     self.assertEqual(results["error"], CRED_ERROR)
Exemple #6
0
 def test_get_specific_jobs_invalid_credential(self):
     results = interface.get_specific_jobs(None, [])
     self.assertEqual(results["error"], CRED_ERROR)