#NEWLINE# def test_while_not( self ) : #NEWLINE# #INDENT# an_event = Event ( ) #NEWLINE# an_event . set ( ) #NEWLINE# mocked_method = MagicMock ( ) #NEWLINE# mocked_time = MagicMock ( ) #NEWLINE# mocked_time . sleep . side_effect = ( lambda x : an_event . clear ( ) ) #NEWLINE# mocked_method . __name__ = 'name' #NEWLINE# with patch . multiple ( 'gitfs.utils.decorators.while_not' , wraps = MockedWraps , time = an_event ) : #NEWLINE# #INDENT# not_now = while_not ( an_event ) #NEWLINE# not_now ( mocked_method ) ( 'arg' , kwarg = 'kwarg' ) #NEWLINE# mocked_time . sleep . assert_called_once_with ( 0.2 )