webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Public Attributes | List of all members
webkitpy.common.system.logtesting.TestLogStream Class Reference
Inheritance diagram for webkitpy.common.system.logtesting.TestLogStream:

Public Member Functions

def __init__ (self, test_case)
 
def write (self, message)
 
def flush (self)
 
def assertMessages (self, messages)
 

Public Attributes

 messages
 

Detailed Description

Represents a file-like object for unit-testing logging.

This is meant for passing to the logging.StreamHandler constructor.
Log messages captured by instances of this object can be tested
using self.assertMessages() below.

Constructor & Destructor Documentation

◆ __init__()

def webkitpy.common.system.logtesting.TestLogStream.__init__ (   self,
  test_case 
)
Create an instance.

Args:
  test_case: A unittest.TestCase instance.

Member Function Documentation

◆ assertMessages()

def webkitpy.common.system.logtesting.TestLogStream.assertMessages (   self,
  messages 
)
Assert that the given messages match the logged messages.

messages: A list of log message strings.

◆ flush()

def webkitpy.common.system.logtesting.TestLogStream.flush (   self)

◆ write()

def webkitpy.common.system.logtesting.TestLogStream.write (   self,
  message 
)

Member Data Documentation

◆ messages

webkitpy.common.system.logtesting.TestLogStream.messages

The documentation for this class was generated from the following file: