コード例 #1
0
 def setUp(self):
     # Print RabbitMQ log on errors. Useful for debugging Travis failures.
     import os
     os.environ["RABBITMQ_ENABLED_PLUGINS_FILE"] = "/dev/null"
     try:
         super(RabbitServerWithoutReset, self).setUp()
     except Exception as error:
         message = str(error)
         if message.startswith("Timeout waiting for RabbitMQ server"):
             content = Content(UTF8_TEXT,
                 lambda: open(self.config.logfile, "r").readlines())
             print content.as_text()
             raise error
コード例 #2
0
ファイル: test_content.py プロジェクト: ClusterHQ/testtools
 def test_as_text(self):
     content_type = ContentType("text", "strange", {"charset": "utf8"})
     content = Content(
         content_type, lambda: [_u("bytes\xea").encode("utf8")])
     self.assertEqual(_u("bytes\xea"), content.as_text())
コード例 #3
0
 def test_as_text(self):
     content_type = ContentType("text", "strange", {"charset": "utf8"})
     content = Content(content_type,
                       lambda: [_u("bytes\xea").encode("utf8")])
     self.assertEqual(_u("bytes\xea"), content.as_text())