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/12/18 22:05:47 UTC

[03/16] git commit: [#5502] ticket:462 Added test to check installation limit of tools

[#5502] ticket:462 Added test to check installation limit of tools


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

Branch: refs/heads/master
Commit: cd4b44f7ea20ed5c4109da027e9f4854502853e6
Parents: ce94cc6
Author: Andriy Sherepa <as...@gmail.com>
Authored: Fri Nov 22 13:10:05 2013 +0200
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Dec 18 20:38:57 2013 +0000

----------------------------------------------------------------------
 Allura/allura/tests/functional/test_admin.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/cd4b44f7/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 12dd42b..c0b70af 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -1110,6 +1110,25 @@ class TestRestInstallTool(TestRestApiBase):
             assert_equals(r.json['success'], False)
             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
+
+        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.')
+
     def test_unauthorized(self):
         r = self.api_get('/rest/p/test/')
         tools_names = [t['name'] for t in r.json['tools']]