def test_invalid_token(self, invalid_token): with pytest.raises(ValidationError): check_token(invalid_token)
def test_valid(self): assert check_token(VALID_TOKEN) is True
def test_invalid_token(): with pytest.raises(exceptions.ValidationError): api.check_token(INVALID_TOKEN)
def test_valid_token(): assert api.check_token(VALID_TOKEN)
def valid_api_token(cls, value): try: check_token(value) return value except exceptions.ValidationError as e: raise ValueError(e)
def test_invalid_token(self): with pytest.raises(ValidationError): check_token(INVALID_TOKEN)