mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
26 lines
682 B
Python
26 lines
682 B
Python
from __future__ import annotations
|
|
|
|
import unittest
|
|
from typing import Any
|
|
|
|
from fixtures.schema_validation import invalid_schema
|
|
from sentry.api.validators.sentry_apps.schema import validate_component
|
|
|
|
|
|
class TestHeaderSchemaValidation(unittest.TestCase):
|
|
def setUp(self):
|
|
self.schema: dict[str, Any] = {"type": "header", "text": "Beep"}
|
|
|
|
def test_valid_schema(self):
|
|
validate_component(self.schema)
|
|
|
|
@invalid_schema
|
|
def test_missing_text(self):
|
|
del self.schema["text"]
|
|
validate_component(self.schema)
|
|
|
|
@invalid_schema
|
|
def test_invalid_text_type(self):
|
|
self.schema["text"] = 1
|
|
validate_component(self.schema)
|