allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [4/5] git commit: [#7160] ticket:557 add test for URL validator
Date Thu, 27 Mar 2014 16:12:31 GMT
[#7160] ticket:557 add test for URL validator


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

Branch: refs/heads/master
Commit: ee90c939e759eb3d8edc978d7756d4a28d0731a4
Parents: 3f5a206
Author: Yuriy Arhipov <yuriyarhipovua@yandex.ru>
Authored: Fri Mar 7 03:26:16 2014 +0400
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Thu Mar 27 16:12:14 2014 +0000

----------------------------------------------------------------------
 .../tests/functional/test_controllers.py        | 23 ++++++++++++++++++++
 1 file changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/ee90c939/ForgeSVN/forgesvn/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/functional/test_controllers.py b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
index c5bb2ee..6aeca55 100644
--- a/ForgeSVN/forgesvn/tests/functional/test_controllers.py
+++ b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
@@ -308,6 +308,29 @@ class TestImportController(SVNTestController):
                       {'checkout_url': 'http://fake.svn/'})
         assert tasks.reclone.post.called
 
+    @patch('forgesvn.svn_main.allura.tasks.repo_tasks')
+    @with_tool('test', 'SVN', 'empty', 'empty SVN')
+    def test_validator(self, tasks):
+        r = self.app.post('/p/test/admin/empty/importer/do_import',
+                      {'checkout_url': 'http://fake.svn/'})
+        assert 'That is not a valid URL' not in r
+
+        r = self.app.post('/p/test/admin/empty/importer/do_import',
+                      {'checkout_url': 'http://1.1.1.1'})
+        assert 'That is not a valid URL' not in r
+
+        r = self.app.post('/p/test/admin/empty/importer/do_import',
+                      {'checkout_url': 'http://1.1.1'})
+        assert 'That is not a valid URL' in r
+
+        r = self.app.post('/p/test/admin/empty/importer/do_import',
+                      {'checkout_url': 'http://256.200.200.200'})
+        assert 'That is not a valid URL' in r
+
+        r = self.app.post('/p/test/admin/empty/importer/do_import',
+                      {'checkout_url': 'http://fak#e.svn/'})
+        assert 'That is not a valid URL' in r
+
 
 class SVNTestRenames(TestController):
 


Mime
View raw message