Skip to content

Commit

Permalink
[uss_qualifier] Relax type requirements when performing test checks (#…
Browse files Browse the repository at this point in the history
…395)

Relax type requirements when performing test checks
  • Loading branch information
BenjaminPelletier authored Dec 11, 2023
1 parent ac17e69 commit 2b53922
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions monitoring/uss_qualifier/scenarios/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,18 @@ def record_failed(
summary: str,
severity: Severity,
details: str = "",
participants: Optional[List[ParticipantID]] = None,
participants: Optional[Union[ParticipantID, List[ParticipantID]]] = None,
query_timestamps: Optional[List[datetime]] = None,
additional_data: Optional[dict] = None,
requirements: Optional[List[str]] = None,
requirements: Optional[Union[str, List[str]]] = None,
) -> None:
self._outcome_recorded = True
if isinstance(participants, str):
participants = [participants]
if participants is None:
participants = self._participants
if isinstance(requirements, str):
requirements = [requirements]
if requirements is None:
requirements = self._documentation.applicable_requirements

Expand Down Expand Up @@ -388,8 +392,12 @@ def _get_check(self, name: str) -> TestCheckDocumentation:
return available_checks[name]

def check(
self, name: str, participants: Optional[List[ParticipantID]] = None
self,
name: str,
participants: Optional[Union[ParticipantID, List[ParticipantID]]] = None,
) -> PendingCheck:
if isinstance(participants, str):
participants = [participants]
self._expect_phase({ScenarioPhase.RunningTestStep, ScenarioPhase.CleaningUp})
available_checks = {c.name: c for c in self._current_step.checks}
if name in available_checks:
Expand Down

0 comments on commit 2b53922

Please sign in to comment.