#NEWLINE# def test_grant_user_access_not_found( self ) : #NEWLINE# #INDENT# inst = self . instance #NEWLINE# mgr = inst . _user_manager #NEWLINE# mgr . api . method_put = Mock ( side_effect = exc . NotFound ( '' ) ) #NEWLINE# username = utils . random_unicode ( ) #NEWLINE# user = fakes . FakeDatabaseUser ( mgr , info = { #NEWLINE# #INDENT# 'name' : username , #NEWLINE# #UNINDENT# } ) #NEWLINE# db_names = utils . random_unicode ( ) #NEWLINE# mgr . _get_db_names = Mock ( return_value = [ ] ) #NEWLINE# self . assertRaises ( exc . NoSuchDatabaseUser , mgr . grant_user_access , user , db_names )