You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2013/08/21 17:27:26 UTC

[44/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/d87f7ae9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/d87f7ae9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/d87f7ae9

Branch: refs/heads/db/3154b
Commit: d87f7ae99c7986d36a41b8ba5b24c673c05297ba
Parents: 6d3d0bb
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Tue Aug 13 17:25:27 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Aug 21 15:25:59 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/d87f7ae9/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/d87f7ae9/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')