diff --git a/invenio_jobs/services/results.py b/invenio_jobs/services/results.py index ace2485..29c9c14 100644 --- a/invenio_jobs/services/results.py +++ b/invenio_jobs/services/results.py @@ -25,7 +25,10 @@ class AttrDict(dict): + """Helper class to fake API layer.""" + def __init__(self, *args, **kwargs): + """Constructor.""" super(AttrDict, self).__init__(*args, **kwargs) self.__dict__ = self diff --git a/invenio_jobs/services/schema.py b/invenio_jobs/services/schema.py index 0bf92fe..f77e01d 100644 --- a/invenio_jobs/services/schema.py +++ b/invenio_jobs/services/schema.py @@ -14,15 +14,7 @@ from invenio_i18n import lazy_gettext as _ from invenio_users_resources.services import schemas as user_schemas -from marshmallow import ( - EXCLUDE, - Schema, - fields, - post_load, - pre_dump, - pre_load, - validate, -) +from marshmallow import EXCLUDE, Schema, fields, post_load, pre_dump, pre_load, validate from marshmallow_oneofschema import OneOfSchema from marshmallow_utils.fields import SanitizedUnicode, TZDateTime from marshmallow_utils.permissions import FieldPermissionsMixin diff --git a/tests/resources/test_resources.py b/tests/resources/test_resources.py index 6c00e64..3feb060 100644 --- a/tests/resources/test_resources.py +++ b/tests/resources/test_resources.py @@ -61,7 +61,7 @@ def test_simple_flow(mock_apply_async, app, db, client, user): list_repr = deepcopy(expected_job) list_repr.update( { - "last_run": {"queue": "celery", "title": "Manual run"}, + "last_run": {"title": "Manual run"}, "last_runs": { "cancelled": {}, "cancelling": {}, @@ -324,7 +324,7 @@ def test_jobs_search(client, jobs): "type": "interval", "hours": 4, }, - "last_run": {"queue": "celery", "title": "Manual run"}, + "last_run": {"title": "Manual run"}, "last_runs": { "cancelled": {}, "cancelling": {}, @@ -360,7 +360,7 @@ def test_jobs_search(client, jobs): "day_of_month": "*", "month_of_year": "*", }, - "last_run": {"queue": "celery", "title": "Manual run"}, + "last_run": {"title": "Manual run"}, "last_runs": { "cancelled": {}, "cancelling": {}, @@ -389,7 +389,7 @@ def test_jobs_search(client, jobs): "default_queue": "low", "default_args": "{}", "schedule": None, - "last_run": {"queue": "celery", "title": "Manual run"}, + "last_run": {"title": "Manual run"}, "last_runs": { "cancelled": {}, "cancelling": {},