<s> """<STR_LIT>""" <EOL> import itertools <EOL> try : <EOL> import unittest2 as unittest <EOL> except ImportError : <EOL> import unittest <EOL> import see <EOL> def union ( * sets ) : <EOL> return set ( itertools . chain ( * sets ) ) <EOL> SIGN_OPS = set ( [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> NUMBER_OPS = set ( '<STR_LIT>' . split ( ) ) <EOL> NUMBER_ASSIGN_OPS = set ( ) <EOL> BITWISE_OPS = set ( '<STR_LIT>' . split ( ) ) <EOL> BITWISE_ASSIGN_OPS = set ( op + '<STR_LIT:=>' for op in BITWISE_OPS ) <EOL> COMPARE_OPS = set ( '<STR_LIT>' . split ( ) ) <EOL> MATRIX_OPS = set ( [ '<STR_LIT:@>' ] ) <EOL> MATRIX_ASSIGN_OPS = set ( [ '<STR_LIT>' ] ) <EOL> ALL_OPS = union ( <EOL> SIGN_OPS , <EOL> NUMBER_OPS , <EOL> NUMBER_ASSIGN_OPS , <EOL> BITWISE_OPS , <EOL> BITWISE_ASSIGN_OPS , <EOL> COMPARE_OPS , <EOL> MATRIX_OPS , <EOL> MATRIX_ASSIGN_OPS , <EOL> ) <EOL> class TestSeeOutput ( unittest . TestCase ) : <EOL> def check_ops ( self , obj_type , expected_ops , see_output ) : <EOL> for op in ALL_OPS : <EOL> if op in expected_ops : <EOL> self . assertIn ( <EOL> op , see_output , <EOL> '<STR_LIT>' % ( obj_type , op ) ) <EOL> else : <EOL> self . assertNotIn ( <EOL> op , see_output , <EOL> '<STR_LIT>' % ( obj_type , op ) ) <EOL> def test_int ( self ) : <EOL> obj = <NUM_LIT:1> <EOL> lit_ops = union ( <EOL> SIGN_OPS , <EOL> NUMBER_OPS , <EOL> BITWISE_OPS , <EOL> COMPARE_OPS , <EOL> ) <EOL> obj_ops = union ( <EOL> lit_ops , <EOL> ) <EOL> lit_see = see . see ( <NUM_LIT:1> ) <EOL> obj_see = see . see ( obj ) <EOL> self . check_ops ( '<STR_LIT>' , lit_ops , lit_see ) <EOL> self . check_ops ( '<STR_LIT>' , obj_ops , obj_see ) <EOL> def test_float ( self ) : <EOL> obj = <NUM_LIT:1.0> <EOL> lit_ops = union ( <EOL> SIGN_OPS , <EOL> NUMBER_OPS , <EOL> COMPARE_OPS , <EOL> ) <EOL> obj_ops = union ( <EOL> lit_ops , <EOL> ) <EOL> lit_see = see . see ( <NUM_LIT:1.0> ) <EOL> obj_see = see . see ( obj ) <EOL> self . check_ops ( '<STR_LIT>' , lit_ops , lit_see ) <EOL> self . check_ops ( '<STR_LIT>' , obj_ops , obj_see ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
