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 22:12:30 UTC

[14/50] git commit: [#3153] ticket:389 fixed tests for export

[#3153] ticket:389 fixed tests for export


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

Branch: refs/heads/db/3154b
Commit: 2d4dfb7369f9f5831f960e50fdefd0f503e7b92a
Parents: ad3cb9f
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Tue Jul 23 19:17:07 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Aug 21 18:12:24 2013 +0000

----------------------------------------------------------------------
 Allura/allura/tests/functional/test_admin.py | 16 ++++++++--------
 Allura/allura/tests/test_tasks.py            |  6 +++---
 2 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2d4dfb73/Allura/allura/tests/functional/test_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_admin.py b/Allura/allura/tests/functional/test_admin.py
index 774fd36..d3a5bd9 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -776,8 +776,8 @@ class TestExport(TestController):
         self.setup_with_tools()
 
     @td.with_wiki
-    @td.with_tool('test', 'Wiki', 'wiki2', 'Wiki 2')
     @td.with_tool('test', 'Tickets', 'bugs', 'Bugs')
+    @td.with_tool('test', 'ShortUrl', 'urls', 'Urls')
     def setup_with_tools(self):
         pass
 
@@ -785,7 +785,7 @@ class TestExport(TestController):
         project = M.Project.query.get(shortname='test')
         tools = [t.options.mount_point
                  for t in AdminApp.exportable_tools_for(project)]
-        assert_equals(tools, [u'wiki', u'wiki2'])
+        assert_equals(tools, [u'wiki', u'bugs'])
 
     def test_access(self):
         r = self.app.get('/admin/export',
@@ -804,15 +804,15 @@ class TestExport(TestController):
     def test_export_page_contains_exportable_tools(self):
         r = self.app.get('/admin/export')
         assert_in('Wiki</label> <a href="/p/test/wiki/">/p/test/wiki/</a>', r)
-        assert_in('Wiki 2</label> <a href="/p/test/wiki2/">/p/test/wiki2/</a>', r)
-        assert_not_in('Bugs</label> <a href="/p/test/bugs/">/p/test/bugs/</a>', r)
+        assert_in('Bugs</label> <a href="/p/test/bugs/">/p/test/bugs/</a>', r)
+        assert_not_in('Urls</label> <a href="/p/test/urls/">/p/test/urls/</a>', r)
 
     def test_tools_not_selected(self):
         r = self.app.post('/admin/export')
         assert_in('error', self.webflash(r))
 
     def test_bad_tool(self):
-        r = self.app.post('/admin/export', {'tools': u'bugs'})
+        r = self.app.post('/admin/export', {'tools': u'urls'})
         assert_in('error', self.webflash(r))
 
     @mock.patch('allura.ext.admin.admin_main.export_tasks')
@@ -824,10 +824,10 @@ class TestExport(TestController):
 
     @mock.patch('allura.ext.admin.admin_main.export_tasks')
     def test_selected_multiple_tools(self, export_tasks):
-        r = self.app.post('/admin/export', {'tools': [u'wiki', u'wiki2']})
+        r = self.app.post('/admin/export', {'tools': [u'wiki', u'bugs']})
         assert_in('ok', self.webflash(r))
         export_tasks.bulk_export.post.assert_called_once_with(
-            'test', [u'wiki', u'wiki2'], u'test-admin')
+            'test', [u'wiki', u'bugs'], u'test-admin')
 
     @patch('allura.ext.admin.admin_main.export_tasks')
     def test_export_in_progress(self, export_tasks):
@@ -835,7 +835,7 @@ class TestExport(TestController):
         tmpdir = os.path.join(p.bulk_export_path(), p.shortname)
         shutil.rmtree(p.bulk_export_path(), ignore_errors=True)
         os.makedirs(tmpdir)
-        r = self.app.post('/admin/export', {'tools': [u'wiki', u'wiki2']})
+        r = self.app.post('/admin/export', {'tools': [u'wiki', u'bugs']})
         assert_in('info', self.webflash(r))
         assert_equals(export_tasks.bulk_export.post.call_count, 0)
         shutil.rmtree(p.bulk_export_path(), ignore_errors=True)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2d4dfb73/Allura/allura/tests/test_tasks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_tasks.py b/Allura/allura/tests/test_tasks.py
index 39c3397..654ed37 100644
--- a/Allura/allura/tests/test_tasks.py
+++ b/Allura/allura/tests/test_tasks.py
@@ -354,13 +354,13 @@ class TestExportTasks(unittest.TestCase):
             mock.call('Can not load app for blog mount point. Skipping.')])
 
     @mock.patch('allura.tasks.export_tasks.log')
-    @td.with_tool('test', 'Tickets', 'bugs')
+    @td.with_tool('test', 'ShortUrl', 'urls')
     @td.with_tool('test', 'Blog', 'blog')
     def test_bulk_export_not_exportable_tool(self, log):
-        export_tasks.bulk_export('test', [u'bugs', u'blog'], 'test-admin')
+        export_tasks.bulk_export('test', [u'urls', u'blog'], 'test-admin')
         assert_equal(log.info.call_count, 2)
         assert_equal(log.info.call_args_list, [
-            mock.call('Tool bugs is not exportable. Skipping.'),
+            mock.call('Tool urls is not exportable. Skipping.'),
             mock.call('Tool blog is not exportable. Skipping.')])
 
     @mock.patch('allura.tasks.export_tasks.shutil')