<s> """<STR_LIT>""" <EOL> import unittest <EOL> if not hasattr ( unittest . TestCase , '<STR_LIT>' ) : <EOL> def assertIsInstance ( self , obj , cls ) : <EOL> assert isinstance ( obj , cls ) , "<STR_LIT>" % ( str ( obj ) , str ( cls ) ) <EOL> unittest . TestCase . assertIsInstance = assertIsInstance <EOL> if not hasattr ( unittest . TestCase , '<STR_LIT>' ) : <EOL> def assertIn ( self , what , collection ) : <EOL> assert what in collection , '<STR_LIT>' % ( str ( what ) , str ( collection ) ) <EOL> unittest . TestCase . assertIn = assertIn <EOL> if not hasattr ( unittest . TestCase , '<STR_LIT>' ) : <EOL> def assertGreater ( self , what , val ) : <EOL> assert what > val , '<STR_LIT>' % ( str ( what ) , str ( val ) ) <EOL> unittest . TestCase . assertGreater = assertGreater <EOL> if not hasattr ( unittest . TestCase , '<STR_LIT>' ) : <EOL> def assertLess ( self , what , val ) : <EOL> assert what < val , '<STR_LIT>' % ( str ( what ) , str ( val ) ) <EOL> unittest . TestCase . assertLess = assertLess <EOL> if not hasattr ( unittest . TestCase , '<STR_LIT>' ) : <EOL> def assertGreaterEqual ( self , what , val ) : <EOL> assert what >= val , '<STR_LIT>' % ( str ( what ) , str ( val ) ) <EOL> unittest . TestCase . assertGreaterEqual = assertGreaterEqual <EOL> if not hasattr ( unittest . TestCase , '<STR_LIT>' ) : <EOL> def assertLessEqual ( self , what , val ) : <EOL> assert what <= val , '<STR_LIT>' % ( str ( what ) , str ( val ) ) <EOL> unittest . TestCase . assertLessEqual = assertLessEqual <EOL> if not hasattr ( unittest . TestCase , '<STR_LIT>' ) : <EOL> def assertIsNot ( self , what , isnota ) : <EOL> assert what is not isnota , '<STR_LIT>' % ( str ( what ) , str ( isnota ) ) <EOL> unittest . TestCase . assertIsNot = assertIsNot <EOL> if not hasattr ( unittest . TestCase , '<STR_LIT>' ) : <EOL> def assertIsNone ( self , what ) : <EOL> assert what is None , '<STR_LIT>' % ( str ( what ) ) <EOL> unittest . TestCase . assertIsNone = assertIsNone <EOL> if not hasattr ( unittest . TestCase , '<STR_LIT>' ) : <EOL> def assertIsNotNone ( self , what ) : <EOL> assert what is not None , '<STR_LIT>' % ( str ( what ) ) <EOL> unittest . TestCase . assertIsNotNone = assertIsNotNone <EOL> if not hasattr ( unittest . TestCase , '<STR_LIT>' ) : <EOL> def assertRaisesRegex ( self , assertType , regex , call , * args , ** kw ) : <EOL> completed = False <EOL> try : <EOL> call ( * args , ** kw ) <EOL> completed = True <EOL> except assertType as ex : <EOL> import re <EOL> assert re . match ( regex , str ( ex ) ) , '<STR_LIT>' % ( <EOL> regex , str ( ex ) ) <EOL> except Exception as ex : <EOL> self . assertFalse ( True , '<STR_LIT>' % ( <EOL> str ( call ) , str ( ex ) , str ( assertType ) ) ) <EOL> if completed : <EOL> self . assertFalse ( True , '<STR_LIT>' % ( <EOL> str ( call ) , str ( args ) , str ( kw ) , str ( assertType ) ) ) <EOL> unittest . TestCase . assertRaisesRegex = assertRaisesRegex <EOL> try : <EOL> skip = unittest . skip <EOL> except : <EOL> def skip ( mssg ) : <EOL> return lambda s : True </s>
