Beispiel #1
0
    def validate_all_actions(self, actions: list) -> None:
        """
        Validates all keys and raises exception with list of all invalid keys
        """
        invalid_actions = [
            action for action in actions if not ActionName.is_valid_action(action)
        ]

        if invalid_actions:
            raise ValidationError(f"Unknown action(s) provided: {invalid_actions}")
Beispiel #2
0
def test_is_valid(action, valid):
    assert ActionName.is_valid_action(action) == valid