# Path: nomad/api/exceptions.py
# class BaseNomadException(Exception):
# class URLNotFoundNomadException(BaseNomadException):
# class URLNotAuthorizedNomadException(BaseNomadException):
# class BadRequestNomadException(BaseNomadException):
# class InvalidParameters(Exception):
# class TimeoutNomadException(requests.exceptions.RequestException):
#     def __init__(self, nomad_resp):
#     def __str__(self):


import json
import os
import uuid
import pytest
import responses
import nomad
import tests.common as common
from flaky import flaky
from nomad.api import exceptions
    assert j["ID"] == a[0]["JobID"]


def test_get_evaluations(nomad_setup):
    j = nomad_setup.job["example"]
    e = nomad_setup.job.get_evaluations("example")
    assert j["ID"] == e[0]["JobID"]


def test_evaluate_job(nomad_setup):
    assert "EvalID" in nomad_setup.job.evaluate_job("example")

# def test_periodic_job(nomad_setup):
#     assert "EvalID" in nomad_setup.job.periodic_job("example")


def test_delete_job(nomad_setup):
    assert "EvalID" in nomad_setup.job.deregister_job("example")
    test_register_job(nomad_setup)


@flaky(max_runs=5, min_passes=1)
@pytest.mark.skipif(tuple(int(i) for i in os.environ.get("NOMAD_VERSION").split(".")) < (0, 5, 3), reason="Nomad dispatch not supported")
def test_dispatch_job(nomad_setup):
    with open("example_batch_parameterized.json") as fh:
        job = json.loads(fh.read())
        nomad_setup.job.register_job("example-batch", job)
    try:
        nomad_setup.job.dispatch_job("example-batch", meta={"time": "500"})
    except (exceptions.URLNotFoundNomadException,

# Path: nomad/api/exceptions.py
# class BaseNomadException(Exception):
# class URLNotFoundNomadException(BaseNomadException):
# class URLNotAuthorizedNomadException(BaseNomadException):
# class BadRequestNomadException(BaseNomadException):
# class InvalidParameters(Exception):
# class TimeoutNomadException(requests.exceptions.RequestException):
#     def __init__(self, nomad_resp):
#     def __str__(self):


# Path: tests/test_job.py
import json
import os
import uuid
import pytest
import responses
import nomad
import tests.common as common
from flaky import flaky
from nomad.api import exceptions

    assert j["ID"] == a[0]["JobID"]


def test_get_evaluations(nomad_setup):
    j = nomad_setup.job["example"]
    e = nomad_setup.job.get_evaluations("example")
    assert j["ID"] == e[0]["JobID"]


def test_evaluate_job(nomad_setup):
    assert "EvalID" in nomad_setup.job.evaluate_job("example")

# def test_periodic_job(nomad_setup):
#     assert "EvalID" in nomad_setup.job.periodic_job("example")


def test_delete_job(nomad_setup):
    assert "EvalID" in nomad_setup.job.deregister_job("example")
    test_register_job(nomad_setup)


@flaky(max_runs=5, min_passes=1)
@pytest.mark.skipif(tuple(int(i) for i in os.environ.get("NOMAD_VERSION").split(".")) < (0, 5, 3), reason="Nomad dispatch not supported")
def test_dispatch_job(nomad_setup):
    with open("example_batch_parameterized.json") as fh:
        job = json.loads(fh.read())
        nomad_setup.job.register_job("example-batch", job)
    try:
        nomad_setup.job.dispatch_job("example-batch", meta={"time": "500"})
    except (exceptions.URLNotFoundNomadException,

            exceptions.BaseNomadException) as e: