Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ def encode_error(cls, v, values, field):
# # Found everything
# return v

@validator("tests")
@validator("tests", always=True)
def tests_validate(cls, v, values):
if values.get("status","") != DetectionStatus.production and not v:
if values.get("status","") == DetectionStatus.production.value and not v:
raise ValueError(
"tests value is needed for production detection: " + values["name"]
)
Expand All @@ -153,7 +153,7 @@ def datamodel_valid(cls, v, values):
return v

def all_tests_successful(self) -> bool:
if len(self.tests) == 0:
if len(self.tests) == 0 and self.status is DetectionStatus.production.value:
return False
for test in self.tests:
if test.result is None or test.result.success == False:
Expand Down