def test_deleted_folder_on_select(monkeypatch, generic_client, constants):
 def raise_invalid_folder_exc(*args, **kwargs):
  raise imapclient.IMAPClient.Error("select failed: '[TRYCREATE] EXAMINE error - Folder does not exist or server encountered an error")
 monkeypatch.setattr('imapclient.IMAPClient.select_folder', raise_invalid_folder_exc)
 with pytest.raises(FolderMissingError):
  generic_client.select_folder('missing_folder', (lambda : True))

def test_deleted_folder_on_select ( monkeypatch , generic_client , constants ) : def raise_invalid_folder_exc ( * args , ** kwargs ) : raise imapclient . IMAPClient . Error ( "select failed: '[TRYCREATE] EXAMINE error - Folder does not exist or server encountered an error" ) monkeypatch . setattr ( 'imapclient.IMAPClient.select_folder' , raise_invalid_folder_exc ) with pytest . raises ( FolderMissingError ) : generic_client . select_folder ( 'missing_folder' , ( lambda : True ) )
test that a select failed examine error specifying that a folder doesnt exist is converted into a foldermissingerror .