Exemplo n.º 1
0
 def _parse_outcome(outcome: str) -> Outcome:
     try:
         return Outcome.parse(outcome)
     except KeyError:
         raise InvalidField(f'Invalid outcome: "{outcome}"')
Exemplo n.º 2
0
def test_parse_outcome(name, outcome):
    """
    Asserts *case insensitive* parsing of outcomes from their canonical names,
    as used in the API and queries.
    """
    assert Outcome.parse(name) == outcome