TestCenter Reference
TestSupport.MessageFilters.MessageFilter Class Reference
Inheritance diagram for TestSupport.MessageFilters.MessageFilter:
TestSupport.MessageFilters.ErrorMessageFilter TestSupport.MessageFilters.InfoMessageFilter TestSupport.MessageFilters.WarningMessageFilter

Public Member Functions

def __init__ (self, MessageHandling handling, Optional[str] regEx)
 
bool match (self, str messageText)
 
str getTypePostfix (self)
 
bool __eq__ (self, other)
 
MessageType GetMessageType (cls)
 
bool IsTypeMatch (cls, str typeString)
 

Public Attributes

 hadMatch
 
 hadNonMatch
 

Detailed Description

Base class to implement filters for specific log messages, allowing e.g. to expect or ignore errors.

Definition at line 34 of file MessageFilters.py.

Constructor & Destructor Documentation

◆ __init__()

def TestSupport.MessageFilters.MessageFilter.__init__ (   self,
MessageHandling  handling,
Optional[str]   regEx 
)

Member Function Documentation

◆ __eq__()

◆ GetMessageType()

◆ getTypePostfix()

str TestSupport.MessageFilters.MessageFilter.getTypePostfix (   self)
Returns the suitable postfix shown in the test report for the message type based on 
self.__handling

Definition at line 66 of file MessageFilters.py.

References TestSupport.MessageFilters.MessageFilter.__handling.

◆ IsTypeMatch()

bool TestSupport.MessageFilters.MessageFilter.IsTypeMatch (   cls,
str   typeString 
)
Returns True if any of the classes' type identifiers (e.g. 'cerr') occurs in the given typeString.
Note that the check is case insensitive.

Definition at line 91 of file MessageFilters.py.

References TestSupport.MessageFilters.ErrorMessageFilter._typeIdentifiers, TestSupport.MessageFilters.WarningMessageFilter._typeIdentifiers, and TestSupport.MessageFilters.InfoMessageFilter._typeIdentifiers.

◆ match()

bool TestSupport.MessageFilters.MessageFilter.match (   self,
str   messageText 
)
Returns True if the given messageText matches the regex, and also updates the fields
hadMatch and hadNonMatch

Definition at line 50 of file MessageFilters.py.

References TestSupport.MessageFilters.MessageFilter.__isMatch(), TestSupport.MessageFilters.MessageFilter.__regEx, TestSupport.MessageFilters.MessageFilter.hadMatch, and TestSupport.MessageFilters.MessageFilter.hadNonMatch.

Member Data Documentation

◆ hadMatch

TestSupport.MessageFilters.MessageFilter.hadMatch

Definition at line 47 of file MessageFilters.py.

Referenced by TestSupport.MessageFilters.MessageFilter.match().

◆ hadNonMatch

TestSupport.MessageFilters.MessageFilter.hadNonMatch

Definition at line 48 of file MessageFilters.py.

Referenced by TestSupport.MessageFilters.MessageFilter.match().


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