#NEWLINE# def test_class_fixtures_get_reported( self ) : #NEWLINE# #INDENT# 'Make a test case, register a bunch of callbacks for class fixtures\n        on it, and make sure the callbacks are all run in the right order.\n        ' #NEWLINE# class InnerTestCase ( TestCase ) : #NEWLINE# #INDENT# def classSetUp( self ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# def classTearDown( self ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# @ class_setup_teardown #NEWLINE# def __class_setup_teardown( self ) : #NEWLINE# #INDENT# ( yield ) #NEWLINE# #UNINDENT# def test_things( self ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# inner_test_case = InnerTestCase ( ) #NEWLINE# events = ( TestCase . EVENT_ON_RUN_TEST_METHOD , TestCase . EVENT_ON_COMPLETE_TEST_METHOD , TestCase . EVENT_ON_RUN_CLASS_SETUP_METHOD , TestCase . EVENT_ON_COMPLETE_CLASS_SETUP_METHOD , TestCase . EVENT_ON_RUN_CLASS_TEARDOWN_METHOD , TestCase . EVENT_ON_COMPLETE_CLASS_TEARDOWN_METHOD , TestCase . EVENT_ON_RUN_TEST_CASE , TestCase . EVENT_ON_COMPLETE_TEST_CASE ) #NEWLINE# calls_to_callback = [ ] #NEWLINE# def make_callback( event ) : #NEWLINE# #INDENT# def callback( result ) : #NEWLINE# #INDENT# calls_to_callback . append ( ( event , ( result [ 'method' ] [ 'name' ] if result else None ) ) ) #NEWLINE# #UNINDENT# return callback #NEWLINE# #UNINDENT# for event in events : #NEWLINE# #INDENT# inner_test_case . register_callback ( events , make_callback ( event ) ) #NEWLINE# #UNINDENT# inner_test_case . run ( ) #NEWLINE# assert_equal ( calls_to_callback , [ ( TestCase . EVENT_ON_RUN_TEST_CASE , 'run' ) , ( TestCase . EVENT_ON_RUN_CLASS_SETUP_METHOD , '__setup_extra_class_teardowns' ) , ( TestCase . EVENT_ON_COMPLETE_CLASS_SETUP_METHOD , '__setup_extra_class_teardowns' ) , ( TestCase . EVENT_ON_RUN_CLASS_SETUP_METHOD , 'classSetUp' ) , ( TestCase . EVENT_ON_COMPLETE_CLASS_SETUP_METHOD , 'classSetUp' ) , ( TestCase . EVENT_ON_RUN_CLASS_SETUP_METHOD , '__class_setup_teardown' ) , ( TestCase . EVENT_ON_COMPLETE_CLASS_SETUP_METHOD , '__class_setup_teardown' ) , ( TestCase . EVENT_ON_RUN_TEST_METHOD , 'test_things' ) , ( TestCase . EVENT_ON_COMPLETE_TEST_METHOD , 'test_things' ) , ( TestCase . EVENT_ON_RUN_CLASS_TEARDOWN_METHOD , '__class_setup_teardown' ) , ( TestCase . EVENT_ON_COMPLETE_CLASS_TEARDOWN_METHOD , '__class_setup_teardown' ) , ( TestCase . EVENT_ON_RUN_CLASS_TEARDOWN_METHOD , 'classTearDown' ) , ( TestCase . EVENT_ON_COMPLETE_CLASS_TEARDOWN_METHOD , 'classTearDown' ) , ( TestCase . EVENT_ON_RUN_CLASS_TEARDOWN_METHOD , '__setup_extra_class_teardowns' ) , ( TestCase . EVENT_ON_COMPLETE_CLASS_TEARDOWN_METHOD , '__setup_extra_class_teardowns' ) , ( TestCase . EVENT_ON_COMPLETE_TEST_CASE , 'run' ) ] )