Skip to content

Commit

Permalink
♻️ Add study attribute to IngestProcess
Browse files Browse the repository at this point in the history
  • Loading branch information
gsantia committed Jun 1, 2021
1 parent 66cb07b commit fd0e11b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions creator/ingest_runs/common/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ def queue(self):
"""
return django_rq.get_queue(name=self.__queue__)

@property
def study(self):
"""
This should not be accessed.
"""
raise NotImplementedError

@transition(field=state, source=State.NOT_STARTED, target=State.RUNNING)
def start(self):
"""
Expand Down
11 changes: 11 additions & 0 deletions tests/ingest_runs/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
hash_versions,
State,
camel_to_snake,
IngestProcess,
)
from creator.ingest_runs.common.mutations import (
cancel_duplicate_ingest_processes
Expand All @@ -25,6 +26,16 @@
User = get_user_model()


def test_study_not_implemented():
"""
Test that accessing the study attribute of IngestProcess when it isn't
implemented yields a NotImplementedError.
"""
ip = IngestProcess()
with pytest.raises(NotImplementedError):
ip.study


def test_hash_versions(db, clients, prep_file):
"""
Test hash_versions
Expand Down

0 comments on commit fd0e11b

Please sign in to comment.