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/04/24 21:36:52 UTC

git commit: [#5501] Allow 1 and 2-char mount points

Updated Branches:
  refs/heads/tv/5501 [created] 67556499a


[#5501] Allow 1 and 2-char mount points

Signed-off-by: Tim Van Steenburgh <tv...@gmail.com>


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

Branch: refs/heads/tv/5501
Commit: 67556499a0aa5f7ba7dd4311fd1324698cc336ac
Parents: 022d84d
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Wed Apr 24 19:33:03 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Wed Apr 24 19:33:03 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/helpers.py              |    2 +-
 Allura/allura/tests/model/test_project.py |    8 ++++++++
 2 files changed, 9 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/67556499/Allura/allura/lib/helpers.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py
index c6b144f..a941d44 100644
--- a/Allura/allura/lib/helpers.py
+++ b/Allura/allura/lib/helpers.py
@@ -53,7 +53,7 @@ from allura.lib import AsciiDammit
 from .security import has_access
 
 re_path_portion_fragment = re.compile(r'[a-z][-a-z0-9]*')
-re_path_portion = re.compile(r'^[a-z][-a-z0-9]{2,}$')
+re_path_portion = re.compile(r'^[a-z][-a-z0-9]{0,62}$')
 re_clean_vardec_key = re.compile(r'''\A
 ( # first part
 \w+# name...

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/67556499/Allura/allura/tests/model/test_project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_project.py b/Allura/allura/tests/model/test_project.py
index 4f14bf0..0a218b1 100644
--- a/Allura/allura/tests/model/test_project.py
+++ b/Allura/allura/tests/model/test_project.py
@@ -72,6 +72,14 @@ def test_project():
     with td.raises(ToolError):
         # mount point reserved
         c.project.install_app('Wiki', 'feed')
+    with td.raises(ToolError):
+        # mount point too long
+        c.project.install_app('Wiki', 'a' * 64)
+    with td.raises(ToolError):
+        # mount point must begin with letter
+        c.project.install_app('Wiki', '1')
+    # single letter mount points are allowed
+    c.project.install_app('Wiki', 'a')
     # Make sure the project support page is reset if the tool it was pointing
     # to is uninstalled.
     assert c.project.support_page == ''