#NEWLINE# def testGetFieldsFromSequenceWhenValidityNotBeforeFail( self ) : #NEWLINE# #INDENT# 'Test _GetFieldsFromSequence().' #NEWLINE# sig_alg_seq = ( 'a' , 'b' ) #NEWLINE# sig_alg = 'sigalg' #NEWLINE# before_ts = self . mox . CreateMockAnything ( ) #NEWLINE# after_ts = self . mox . CreateMockAnything ( ) #NEWLINE# mock_utctime = self . mox . CreateMockAnything ( ) #NEWLINE# self . stubs . Set ( x509 . pyasn1 . type . useful , 'UTCTime' , mock_utctime ) #NEWLINE# mock_utctime ( ) . AndReturn ( mock_utctime ) #NEWLINE# before_ts . isSameTypeWith ( mock_utctime ) . AndReturn ( False ) #NEWLINE# serial_num = 12345 #NEWLINE# bad_oid_cn = ( 9 * 10 ) #NEWLINE# seq = ( x509 . X509_CERT_VERSION_3 , serial_num , sig_alg_seq , ( ( ( x509 . OID_ID [ 'CN' ] , 'issuer' ) , ) , ) , ( before_ts , after_ts ) , ( ( ( x509 . OID_ID [ 'CN' ] , 'subject' ) , ) , ) , 'public key' , 'x509v3 extensions' ) #NEWLINE# self . mox . StubOutWithMock ( self . x , '_GetSignatureAlgorithmFromSequence' ) #NEWLINE# self . mox . StubOutWithMock ( self . x , '_AssembleDNSequence' ) #NEWLINE# self . x . _GetSignatureAlgorithmFromSequence ( sig_alg_seq ) . AndReturn ( sig_alg ) #NEWLINE# self . x . _AssembleDNSequence ( seq [ 3 ] ) . AndReturn ( 'CN=issuer' ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# self . assertRaises ( x509 . CertificateParseError , self . x . _GetFieldsFromSequence , seq ) #NEWLINE# self . mox . VerifyAll ( )