<s> '''<STR_LIT>''' <EOL> import unittest <EOL> class Test ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> import sys <EOL> sys . argv = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> import build_certhandler <EOL> def testName ( self ) : <EOL> import certhandler <EOL> test = certhandler . Certificate ( <EOL> """<STR_LIT>""" <EOL> ) <EOL> test2 = certhandler . Certificate ( <EOL> """<STR_LIT>""" <EOL> ) <EOL> if not test . IsSelfSigned ( ) : <EOL> raise <EOL> if not test . IsSignedBy ( test ) : <EOL> raise <EOL> if not test2 . IsSelfSigned ( ) : <EOL> raise <EOL> if not test2 . IsSignedBy ( test2 ) : <EOL> raise <EOL> if test2 . IsSignedBy ( test ) : <EOL> raise <EOL> if test . IsSignedBy ( test2 ) : <EOL> raise <EOL> if not test . IssuerNameDER ( ) or test . IssuerNameDER ( ) != test . SubjectNameDER ( ) : <EOL> raise <EOL> if test . IssuerNameLine ( ) != "<STR_LIT>" : <EOL> raise <EOL> if test . SubjectNameLine ( ) != "<STR_LIT>" : <EOL> raise <EOL> if not test2 . IssuerNameDER ( ) or test2 . IssuerNameDER ( ) != test2 . SubjectNameDER ( ) : <EOL> raise <EOL> text = test2 . IssuerNameLine ( ) <EOL> if text != """<STR_LIT>""" : <EOL> raise <EOL> if test2 . SubjectNameLine ( ) != """<STR_LIT>""" : <EOL> raise <EOL> if test . GetSerialNumber ( ) != "<STR_LIT>" : <EOL> raise <EOL> if test2 . GetSerialNumber ( ) != <NUM_LIT> : <EOL> raise <EOL> test_entrust = test2 <EOL> test_digicert = certhandler . Certificate ( <EOL> """<STR_LIT>""" ) <EOL> test_bugs = certhandler . Certificate ( <EOL> """<STR_LIT>""" <EOL> ) <EOL> if not test_digicert . IsSignedBy ( test_entrust ) : <EOL> raise <EOL> if not test_bugs . IsSignedBy ( test_digicert ) : <EOL> raise <EOL> hostnames = test_bugs . ExtractHostnames ( ) ; <EOL> if "<STR_LIT>" not in hostnames or "<STR_LIT>" not in hostnames : <EOL> raise <EOL> temp = hostnames [ "<STR_LIT>" ] <EOL> if not ( len ( temp ) == <NUM_LIT:1> and <EOL> '<STR_LIT>' in temp ) : <EOL> raise <EOL> temp = hostnames [ "<STR_LIT>" ] <EOL> if not ( len ( temp ) == <NUM_LIT:3> and <EOL> '<STR_LIT>' in temp and <EOL> '<STR_LIT>' in temp and <EOL> '<STR_LIT>' in temp ) : <EOL> raise <EOL> if test_bugs . Keysize ( ) != <NUM_LIT> : <EOL> raise <EOL> if test_digicert . Keysize ( ) != <NUM_LIT> : <EOL> raise <EOL> if test_entrust . Keysize ( ) != <NUM_LIT> : <EOL> raise <EOL> certs = certhandler . CertificateLoadP7 ( "<STR_LIT>" ) <EOL> for cert in certs : <EOL> if not cert . IsSelfSigned ( ) : <EOL> print cert . SubjectNameLine ( ) <EOL> raise <EOL> print "<STR_LIT>" <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> import sys ; <EOL> sys . argv = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> unittest . main ( ) </s>
