#NEWLINE# def test_call_with_valid_operation( self ) : #NEWLINE# #INDENT# mocked_view = MagicMock ( ) #NEWLINE# mocked_cache = MagicMock ( ) #NEWLINE# mocked_idle_event = MagicMock ( ) #NEWLINE# ( router , mocks ) = self . get_new_router ( ) #NEWLINE# router . register ( [ ( '/' , MagicMock ( return_value = mocked_cache ) ) ] ) #NEWLINE# with patch . multiple ( 'gitfs.router' , idle = mocked_idle_event , lru_cache = mocked_cache ) : #NEWLINE# #INDENT# mocked_cache . get_if_exists . return_value = None #NEWLINE# result = router ( 'random_operation' , '/' ) #NEWLINE# assert ( result == mocked_view . random_operation ( '/' ) ) #NEWLINE# assert ( mocked_idle_event . clear . call_count == 1 )