def test_publish_one_message(self):
        self.graph.sns_producer.produce(created("foo"), data="data")

        assert_that(
            self.graph.sns_producer,
            published(has_media_type(created("foo")), ),
        )
    def test_publish_two_messages_non_strict(self):
        self.graph.sns_producer.produce(created("foo"), uri="http://localhost")
        self.graph.sns_producer.produce(created("bar"), uri="http://localhost")

        assert_that(
            self.graph.sns_producer,
            published_inanyorder(
                all_of(
                    has_media_type(created("bar")),
                    has_uri("http://localhost"),
                ),
                all_of(
                    has_media_type(created("foo")),
                    has_uri(),
                ),
            ),
        )
    def test_publish_two_messages_non_strict(self):
        self.graph.sns_producer.produce(created("foo"), uri="http://localhost")
        self.graph.sns_producer.produce(created("bar"), uri="http://localhost")

        assert_that(
            self.graph.sns_producer,
            published_inanyorder(
                all_of(
                    has_media_type(created("bar")),
                    has_uri("http://localhost"),
                ),
                all_of(
                    has_media_type(created("foo")),
                    has_uri(),
                ),
            ),
        )
    def test_publish_one_message(self):
        self.graph.sns_producer.produce(created("foo"), data="data")

        assert_that(
            self.graph.sns_producer,
            published(
                has_media_type(created("foo")),
            ),
        )
    def test_publish_one_message(self):
        self.graph.sns_producer.produce(created("foo"), uri="http://localhost")

        assert_that(
            self.graph.sns_producer,
            published(
                all_of(
                    has_media_type(created("foo")),
                    has_uri("http://localhost"),
                ), ),
        )
    def test_publish_one_message(self):
        self.graph.sns_producer.produce(created("foo"), uri="http://localhost")

        assert_that(
            self.graph.sns_producer,
            published(
                all_of(
                    has_media_type(created("foo")),
                    has_uri("http://localhost"),
                ),
            ),
        )