How to use the eliot.testing.assertContainsFields function in eliot

To help you get started, we’ve selected a few eliot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ClusterHQ / flocker / flocker / common / functional / test_script.py View on Github external
def _assert_logfile_messages(self, stdout_messages, logfile):
        """
        Verify that the messages have been logged to a file rather than to
        stdout.
        """
        self.assertEqual([], stdout_messages)
        logfile_messages = map(loads, logfile.getContent().splitlines())
        assertContainsFields(
            # message[0] contains a twisted log message.
            self, logfile_messages[1], {u"key": 123}
        )
github ClusterHQ / flocker / flocker / common / functional / test_script.py View on Github external
        d.addCallback(lambda messages: assertContainsFields(
            self, messages[1], {u"message_type": u"twisted:log",
                                u"message": message,
                                u"error": True}))
        return d
github ClusterHQ / flocker / flocker / common / functional / test_script.py View on Github external
        d.addCallback(lambda messages: assertContainsFields(
            self, messages[1], {u"message_type": u"twisted:log",
                                u"message": u"hello",
                                u"error": False}))
        return d
github ClusterHQ / flocker / flocker / common / functional / test_script.py View on Github external
def got_messages(messages):
            assertContainsFields(self, messages[1],
                                 {u"message_type": u"twisted:log",
                                  u"message": u"stdout!",
                                  u"error": False})
            assertContainsFields(self, messages[2],
                                 {u"message_type": u"twisted:log",
                                  u"message": u"stderr!",
                                  u"error": True})
        d.addCallback(got_messages)
github ClusterHQ / flocker / flocker / common / functional / test_script.py View on Github external
        d.addCallback(lambda messages: assertContainsFields(
            self, messages[1], {u"message_type": u"twisted:log",
                                u"message": u"Received SIGINT, shutting down.",
                                u"error": False}))
        return d
github ClusterHQ / flocker / flocker / common / functional / test_script.py View on Github external
        d.addCallback(lambda messages: assertContainsFields(self, messages[1],
                                                            {u"key": 123}))
        return d
github ClusterHQ / flocker / flocker / common / functional / test_script.py View on Github external
        d.addCallback(lambda messages: assertContainsFields(self, messages[1],
                                                            {u"key": 123}))
        return d
github ClusterHQ / flocker / flocker / common / functional / test_script.py View on Github external
def got_messages(messages):
            assertContainsFields(self, messages[1],
                                 {u"message_type": u"twisted:log",
                                  u"error": True})
            self.assertTrue(messages[1][u"message"].startswith(
                u"Unhandled Error\nTraceback (most recent call last):\n"))
            self.assertTrue(messages[1][u"message"].endswith(
                u"ZeroDivisionError: ono\n"))
        d.addCallback(got_messages)