# Path: draftjs_exporter/constants.py
# class BLOCK_TYPES:
#     UNSTYLED = "unstyled"
#     HEADER_ONE = "header-one"
#     HEADER_TWO = "header-two"
#     HEADER_THREE = "header-three"
#     HEADER_FOUR = "header-four"
#     HEADER_FIVE = "header-five"
#     HEADER_SIX = "header-six"
#     UNORDERED_LIST_ITEM = "unordered-list-item"
#     ORDERED_LIST_ITEM = "ordered-list-item"
#     BLOCKQUOTE = "blockquote"
#     PRE = "pre"
#     CODE = "code-block"
#     ATOMIC = "atomic"
#     # Special type to configure handling of missing components.
#     FALLBACK = "fallback"
# 
# ENTITY_TYPES = Enum(
#     "LINK",
#     "DOCUMENT",
#     "IMAGE",
#     "EMBED",
#     "HORIZONTAL_RULE",
#     # Special type to configure handling of missing components.
#     "FALLBACK",
# )
# 
# INLINE_STYLES = Enum(
#     "BOLD",
#     "CODE",
#     "ITALIC",
#     "UNDERLINE",
#     "STRIKETHROUGH",
#     "SUPERSCRIPT",
#     "SUBSCRIPT",
#     "MARK",
#     "QUOTATION",
#     "SMALL",
#     "SAMPLE",
#     "INSERT",
#     "DELETE",
#     "KEYBOARD",
#     # Special type to configure handling of missing components.
#     "FALLBACK",
# )
# 
# class Enum(object):
#     __slots__ = "elements"
# 
#     def __init__(self, *elements: str) -> None:
#         self.elements = tuple(elements)
# 
#     def __getattr__(self, name: str) -> str:
#         if name not in self.elements:
#             raise AttributeError(f"'Enum' has no attribute '{name}'")
# 
#         return name


import unittest
from draftjs_exporter.constants import (
    BLOCK_TYPES,
    ENTITY_TYPES,
    INLINE_STYLES,
    Enum,
)



class EnumConstants(unittest.TestCase):
    def test_enum_returns_the_key_if_valid(self):
        foo_value = "foo"
        e = Enum(foo_value)

        self.assertEqual(e.foo, foo_value)

    def test_enum_raises_an_error_for_invalid_keys(self):
        e = Enum("foo", "bar")

        with self.assertRaises(AttributeError):
            e.invalid_key


class TestConstants(unittest.TestCase):
    def test_block_types(self):

# Path: draftjs_exporter/constants.py
# class BLOCK_TYPES:
#     UNSTYLED = "unstyled"
#     HEADER_ONE = "header-one"
#     HEADER_TWO = "header-two"
#     HEADER_THREE = "header-three"
#     HEADER_FOUR = "header-four"
#     HEADER_FIVE = "header-five"
#     HEADER_SIX = "header-six"
#     UNORDERED_LIST_ITEM = "unordered-list-item"
#     ORDERED_LIST_ITEM = "ordered-list-item"
#     BLOCKQUOTE = "blockquote"
#     PRE = "pre"
#     CODE = "code-block"
#     ATOMIC = "atomic"
#     # Special type to configure handling of missing components.
#     FALLBACK = "fallback"
# 
# ENTITY_TYPES = Enum(
#     "LINK",
#     "DOCUMENT",
#     "IMAGE",
#     "EMBED",
#     "HORIZONTAL_RULE",
#     # Special type to configure handling of missing components.
#     "FALLBACK",
# )
# 
# INLINE_STYLES = Enum(
#     "BOLD",
#     "CODE",
#     "ITALIC",
#     "UNDERLINE",
#     "STRIKETHROUGH",
#     "SUPERSCRIPT",
#     "SUBSCRIPT",
#     "MARK",
#     "QUOTATION",
#     "SMALL",
#     "SAMPLE",
#     "INSERT",
#     "DELETE",
#     "KEYBOARD",
#     # Special type to configure handling of missing components.
#     "FALLBACK",
# )
# 
# class Enum(object):
#     __slots__ = "elements"
# 
#     def __init__(self, *elements: str) -> None:
#         self.elements = tuple(elements)
# 
#     def __getattr__(self, name: str) -> str:
#         if name not in self.elements:
#             raise AttributeError(f"'Enum' has no attribute '{name}'")
# 
#         return name


# Path: tests/test_constants.py
import unittest
from draftjs_exporter.constants import (
    BLOCK_TYPES,
    ENTITY_TYPES,
    INLINE_STYLES,
    Enum,
)




class EnumConstants(unittest.TestCase):
    def test_enum_returns_the_key_if_valid(self):
        foo_value = "foo"
        e = Enum(foo_value)

        self.assertEqual(e.foo, foo_value)

    def test_enum_raises_an_error_for_invalid_keys(self):
        e = Enum("foo", "bar")

        with self.assertRaises(AttributeError):
            e.invalid_key


class TestConstants(unittest.TestCase):
    def test_block_types(self):

        self.assertIsInstance(BLOCK_TYPES, object)