# Path: microcosm_pubsub/tests/fixtures.py
# class DuckTypeSchema(Schema):
#     """
#     A duck typed schema
# 
#     """
#     MEDIA_TYPE = "application/vnd.microcosm.duck"
# 
#     quack = fields.String()
# 
# class ExampleDaemon(ConsumerDaemon):
# 
#     @property
#     def name(self):
#         return "example"
# 
#     @property
#     def components(self):
#         return super().components + [
#             "noop_handler",
#         ]
# 
# @handles(DuckTypeSchema)
# @handles(created("Foo"))
# @handles(deleted("Foo"))
# @handles(DerivedSchema.MEDIA_TYPE)
# def noop_handler(message):
#     return True


from hamcrest import (
    assert_that,
    equal_to,
    instance_of,
    is_,
)
from microcosm_pubsub.tests.fixtures import DuckTypeSchema, ExampleDaemon, noop_handler
"""
Decorator tests.

"""



class TestDecorators:

    def setup(self):
        self.daemon = ExampleDaemon.create_for_testing()
        self.graph = self.daemon.graph

    def test_schema_decorators(self):
        assert_that(
            self.graph.pubsub_message_schema_registry.find(DuckTypeSchema.MEDIA_TYPE).schema,

# Path: microcosm_pubsub/tests/fixtures.py
# class DuckTypeSchema(Schema):
#     """
#     A duck typed schema
# 
#     """
#     MEDIA_TYPE = "application/vnd.microcosm.duck"
# 
#     quack = fields.String()
# 
# class ExampleDaemon(ConsumerDaemon):
# 
#     @property
#     def name(self):
#         return "example"
# 
#     @property
#     def components(self):
#         return super().components + [
#             "noop_handler",
#         ]
# 
# @handles(DuckTypeSchema)
# @handles(created("Foo"))
# @handles(deleted("Foo"))
# @handles(DerivedSchema.MEDIA_TYPE)
# def noop_handler(message):
#     return True


# Path: microcosm_pubsub/tests/test_decorators.py
from hamcrest import (
    assert_that,
    equal_to,
    instance_of,
    is_,
)
from microcosm_pubsub.tests.fixtures import DuckTypeSchema, ExampleDaemon, noop_handler

"""
Decorator tests.

"""



class TestDecorators:

    def setup(self):
        self.daemon = ExampleDaemon.create_for_testing()
        self.graph = self.daemon.graph

    def test_schema_decorators(self):
        assert_that(
            self.graph.pubsub_message_schema_registry.find(DuckTypeSchema.MEDIA_TYPE).schema,

            is_(instance_of(DuckTypeSchema)),