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

[20/50] git commit: [#3154] ticket:395 updated bulk_export test

[#3154] ticket:395 updated bulk_export test


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/c71f754d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/c71f754d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/c71f754d

Branch: refs/heads/tv/6595
Commit: c71f754dae279d14c47509ac54986518274fd9ed
Parents: 154814e
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Thu Jul 25 17:09:08 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Aug 22 20:04:43 2013 +0000

----------------------------------------------------------------------
 Allura/allura/tests/test_tasks.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c71f754d/Allura/allura/tests/test_tasks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_tasks.py b/Allura/allura/tests/test_tasks.py
index 06d4ede..cd10683 100644
--- a/Allura/allura/tests/test_tasks.py
+++ b/Allura/allura/tests/test_tasks.py
@@ -366,21 +366,23 @@ class TestExportTasks(unittest.TestCase):
             mock.call('Tool bugs is not exportable. Skipping.'),
             mock.call('Tool blog is not exportable. Skipping.')])
 
+    @mock.patch('allura.model.project.Project.__json__')
     @mock.patch('allura.tasks.export_tasks.shutil')
     @mock.patch('allura.tasks.export_tasks.zipdir')
     @mock.patch('forgewiki.wiki_main.ForgeWikiApp.bulk_export')
     @mock.patch('allura.tasks.export_tasks.log')
     @td.with_wiki
-    def test_bulk_export(self, log, wiki_bulk_export, zipdir, shutil):
+    def test_bulk_export(self, log, wiki_bulk_export, zipdir, shutil, project_json):
         M.MonQTask.query.remove()
         export_tasks.bulk_export('test', [u'wiki'], 'test-admin')
         assert_equal(log.info.call_count, 1)
         assert_equal(log.info.call_args_list, [
             mock.call('Exporting wiki...')])
         wiki_bulk_export.assert_called_once()
+        project_json.assert_called_once()
         temp = '/tmp/bulk_export/p/test/test'
         zipfn = '/tmp/bulk_export/p/test/test.zip'
-        zipdir.assert_caled_once_with(temp, temp + '/test.zip')
+        zipdir.assert_caled_with(temp, temp + '/test.zip')
         shutil.move.assert_called_once_with(temp + '/test.zip',  zipfn)
         shutil.rmtree.assert_called_once_with(temp)
         # check notification