incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [01/36] git commit: [#5502] ticket:462 Fix test failing due to new default instances limit
Date Fri, 20 Dec 2013 18:50:27 GMT
Updated Branches:
  refs/heads/db/6388 5d062a629 -> 8474a348d (forced update)


[#5502] ticket:462 Fix test failing due to new default instances limit


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

Branch: refs/heads/db/6388
Commit: 64aca6c2a81b8276fb2e75b5ff6c680dfce3e6c5
Parents: 1386309
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Thu Nov 28 14:24:45 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Dec 18 20:38:57 2013 +0000

----------------------------------------------------------------------
 Allura/allura/tests/functional/test_admin.py | 33 ++++++++++++-----------
 1 file changed, 18 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/64aca6c2/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 c0b70af..c1f968e 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -49,6 +49,7 @@ from allura.lib.security import has_access
 
 from forgetracker.tracker_main import ForgeTrackerApp
 from forgewiki.model import Page
+from forgewiki.wiki_main import ForgeWikiApp
 
 @contextmanager
 def audits(*messages):
@@ -1111,23 +1112,25 @@ class TestRestInstallTool(TestRestApiBase):
             assert_equals(r.json['info'], 'Incorrect mount point name, or mount point already
exists.')
 
     def test_tool_installation_limit(self):
-        r = self.api_get('/rest/p/test/')
-        tools_names = [t['name'] for t in r.json['tools']]
-        assert 'wiki' not in tools_names
+        with mock.patch.object(ForgeWikiApp, 'max_instances') as mi:
+            mi.__get__ = mock.Mock(return_value=1)
+            r = self.api_get('/rest/p/test/')
+            tools_names = [t['name'] for t in r.json['tools']]
+            assert 'wiki' not in tools_names
 
-        data = {
-            'tool': 'wiki',
-            'mount_point': 'wikimount',
-            'mount_label': 'wiki_label'
-        }
-        r = self.api_post('/rest/p/test/admin/install_tool/', **data)
-        assert_equals(r.json['success'], True)
+            data = {
+                'tool': 'wiki',
+                'mount_point': 'wikimount',
+                'mount_label': 'wiki_label'
+            }
+            r = self.api_post('/rest/p/test/admin/install_tool/', **data)
+            assert_equals(r.json['success'], True)
 
-        data['mount_point'] = 'wikimount1'
-        data['mount_label'] = 'wiki_label1'
-        r = self.api_post('/rest/p/test/admin/install_tool/', **data)
-        assert_equals(r.json['success'], False)
-        assert_equals(r.json['info'], 'Incorrect tool name, or limit is reached.')
+            data['mount_point'] = 'wikimount1'
+            data['mount_label'] = 'wiki_label1'
+            r = self.api_post('/rest/p/test/admin/install_tool/', **data)
+            assert_equals(r.json['success'], False)
+            assert_equals(r.json['info'], 'Incorrect tool name, or limit is reached.')
 
     def test_unauthorized(self):
         r = self.api_get('/rest/p/test/')


Mime
View raw message