Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C03C1108BB for ; Thu, 22 Aug 2013 21:53:29 +0000 (UTC) Received: (qmail 1916 invoked by uid 500); 22 Aug 2013 21:53:29 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 1874 invoked by uid 500); 22 Aug 2013 21:53:29 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 1397 invoked by uid 99); 22 Aug 2013 21:53:29 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Aug 2013 21:53:29 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 27C098C2F53; Thu, 22 Aug 2013 21:53:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: brondsem@apache.org To: allura-commits@incubator.apache.org Date: Thu, 22 Aug 2013 21:54:03 -0000 Message-Id: <9203c27a266b4c93a7d80388fdcebf73@git.apache.org> In-Reply-To: <4368fdfbc40f4eb8b4360cb76e034d25@git.apache.org> References: <4368fdfbc40f4eb8b4360cb76e034d25@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [37/50] git commit: [#3154] ticket:411 test fixes for zip_and_cleanup [#3154] ticket:411 test fixes for zip_and_cleanup Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/68ed96ee Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/68ed96ee Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/68ed96ee Branch: refs/heads/master Commit: 68ed96eec0d97bc04fb4e539c936fa6fadef4f30 Parents: 9a39fca Author: Anton Kasyanov Authored: Tue Aug 13 17:25:27 2013 +0300 Committer: Dave Brondsema Committed: Thu Aug 22 20:04:45 2013 +0000 ---------------------------------------------------------------------- Allura/allura/tasks/export_tasks.py | 9 ++++++--- ForgeDiscussion/forgediscussion/tests/test_app.py | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/68ed96ee/Allura/allura/tasks/export_tasks.py ---------------------------------------------------------------------- diff --git a/Allura/allura/tasks/export_tasks.py b/Allura/allura/tasks/export_tasks.py index 3e2a9af..b5fcb34 100644 --- a/Allura/allura/tasks/export_tasks.py +++ b/Allura/allura/tasks/export_tasks.py @@ -72,9 +72,12 @@ def bulk_export(project_shortname, tools, username, neighborhood): except: log.error('Something went wrong during export of project metadata', exc_info=True) - # If that fails, we need to let it fail - # there won't be a valid zip file for the user to get. - zip_and_cleanup(project) + if tools and len(not_exported_tools) < len(tools): + # If that fails, we need to let it fail + # there won't be a valid zip file for the user to get. + zip_and_cleanup(project) + else: + log.error('Nothing to export') user = M.User.by_username(username) if not user: http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/68ed96ee/ForgeDiscussion/forgediscussion/tests/test_app.py ---------------------------------------------------------------------- diff --git a/ForgeDiscussion/forgediscussion/tests/test_app.py b/ForgeDiscussion/forgediscussion/tests/test_app.py index bc9dcb1..07b65f4 100644 --- a/ForgeDiscussion/forgediscussion/tests/test_app.py +++ b/ForgeDiscussion/forgediscussion/tests/test_app.py @@ -41,6 +41,8 @@ class TestBulkExport(TestDiscussionApiBase): assert_equal(forums[0]['shortname'], u'general') assert_equal(forums[0]['description'], u'Forum about anything you want to talk about.') assert_equal(forums[0]['name'], u'General Discussion') + forums[0]['threads'] = sorted(forums[0]['threads'], + key=lambda x: x['posts'][0]['subject']) assert_equal(forums[0]['threads'][0]['posts'][0]['text'], u'Hi boys and girls') assert_equal(forums[0]['threads'][0]['posts'][0]['subject'], u'Hi guys') assert_equal(forums[0]['threads'][1]['posts'][0]['text'], u'1st post')