Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[uss_qualifier] Relax type requirements when performing test checks #395

Merged
merged 1 commit into from
Dec 11, 2023
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
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
Loading