-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for reason and status conversions
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from dstack._internal.core.models.runs import ( | ||
JobStatus, | ||
JobTerminationReason, | ||
RunStatus, | ||
RunTerminationReason, | ||
) | ||
|
||
|
||
def test_run_to_job_termination_reason_works_with_all_enum_variants(): | ||
for run_termination_reason in RunTerminationReason: | ||
job_termination_reason = run_termination_reason.to_job_termination_reason() | ||
assert isinstance(job_termination_reason, JobTerminationReason) | ||
|
||
|
||
def test_run_termination_reason_to_status_works_with_all_enum_variants(): | ||
for run_termination_reason in RunTerminationReason: | ||
run_status = run_termination_reason.to_status() | ||
assert isinstance(run_status, RunStatus) | ||
|
||
|
||
def test_job_termination_reason_to_status_works_with_all_enum_varians(): | ||
for job_termination_reason in JobTerminationReason: | ||
job_status = job_termination_reason.to_status() | ||
assert isinstance(job_status, JobStatus) |