def testTokenize( self ): _, _, _, tokens= parse_278.tokenize( self.msg1 ) self.assertEquals( 28, len(tokens) ) self.assertEquals( 17, len(tokens[0])) # The ISA Segment self.assertEquals( "ISA", tokens[0][0] ) self.assertEquals( "GS", tokens[1][0] ) self.assertEquals( "ST", tokens[2][0] ) self.assertEquals( "SE", tokens[-3][0] ) self.assertEquals( "GE", tokens[-2][0] ) self.assertEquals( "IEA", tokens[-1][0] )
def testISAMatch( self ): _, _, _, tokens= parse_278.tokenize( self.msg1 ) isaTokens= tokens[0] isa= parse_278.structure[0] self.assertTrue( isa.match(isaTokens) )