<s> '''<STR_LIT>''' <EOL> __docformat__ = '<STR_LIT>' <EOL> __version__ = '<STR_LIT>' <EOL> import time <EOL> import unittest <EOL> from pyglet import clock <EOL> __noninteractive = True <EOL> class SCHEDULE_ONCE ( unittest . TestCase ) : <EOL> callback_1_count = <NUM_LIT:0> <EOL> callback_2_count = <NUM_LIT:0> <EOL> callback_3_count = <NUM_LIT:0> <EOL> def callback_1 ( self , dt ) : <EOL> self . assertTrue ( abs ( dt - <NUM_LIT:0.1> ) < <NUM_LIT> ) <EOL> self . callback_1_count += <NUM_LIT:1> <EOL> def callback_2 ( self , dt ) : <EOL> self . assertTrue ( abs ( dt - <NUM_LIT> ) < <NUM_LIT> ) <EOL> self . callback_2_count += <NUM_LIT:1> <EOL> def callback_3 ( self , dt ) : <EOL> self . assertTrue ( abs ( dt - <NUM_LIT> ) < <NUM_LIT> ) <EOL> self . callback_3_count += <NUM_LIT:1> <EOL> def clear ( self ) : <EOL> self . callback_1_count = <NUM_LIT:0> <EOL> self . callback_2_count = <NUM_LIT:0> <EOL> self . callback_3_count = <NUM_LIT:0> <EOL> def test_schedule_once ( self ) : <EOL> self . clear ( ) <EOL> clock . set_default ( clock . Clock ( ) ) <EOL> clock . schedule_once ( self . callback_1 , <NUM_LIT:0.1> ) <EOL> clock . schedule_once ( self . callback_2 , <NUM_LIT> ) <EOL> clock . schedule_once ( self . callback_3 , <NUM_LIT> ) <EOL> t = <NUM_LIT:0> <EOL> while t < <NUM_LIT:1> : <EOL> t += clock . tick ( ) <EOL> self . assertTrue ( self . callback_1_count == <NUM_LIT:1> ) <EOL> self . assertTrue ( self . callback_2_count == <NUM_LIT:1> ) <EOL> self . assertTrue ( self . callback_3_count == <NUM_LIT:1> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
