Exemplo n.º 1
0
    def status(self) -> Status:  # HACK: should be cached
        if self.conditions.status == Status.UNSTABLE:
            return Status.SKIPPED
        if self.conditions.status == Status.FAILURE:
            return Status.FAILURE

        return merge_statuses([
            self.execution.status,
            self.response.status if self.response else Status.SKIPPED,
        ])
Exemplo n.º 2
0
 def result(self) -> ScenarioResult:
     cases = self._cases.result()
     subscenarios = StatusedList.collect(s.result() for s in self._subscenarios)
     return ScenarioResult(
         label=self._label,
         status=merge_statuses([cases.status, subscenarios.status]),
         conditions=self._conditions,
         cases=cases,
         subscenarios=subscenarios,
     )
Exemplo n.º 3
0
def test_merge_statuses(statuses: Iterable[Status], expected: Status):
    assert merge_statuses(statuses) is expected
Exemplo n.º 4
0
 def collect(children: Iterable[Verification]) -> Verification:
     children = list(children)
     status = merge_statuses(child.status for child in children)
     return Verification(status=status, children=children)
Exemplo n.º 5
0
 def status(self) -> Status:
     return merge_statuses(
         [self.status_code.status, self.headers.status, self.body.status])