incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [01/50] git commit: [#6463] use separate test project from ForgeSVN's tests
Date Thu, 08 Aug 2013 13:34:20 GMT
Updated Branches:
  refs/heads/tv/6458 ca66e4791 -> 91ee891fe (forced update)


[#6463] use separate test project from ForgeSVN's tests


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

Branch: refs/heads/tv/6458
Commit: 2b7de72ef67d3a7216902cfc6073760336d9d67a
Parents: 61d0ca5
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Wed Jul 24 14:55:28 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Jul 24 14:55:51 2013 +0000

----------------------------------------------------------------------
 .../forgeimporters/google/tests/test_code.py     | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2b7de72e/ForgeImporters/forgeimporters/google/tests/test_code.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/tests/test_code.py b/ForgeImporters/forgeimporters/google/tests/test_code.py
index 660bc83..a738b8b 100644
--- a/ForgeImporters/forgeimporters/google/tests/test_code.py
+++ b/ForgeImporters/forgeimporters/google/tests/test_code.py
@@ -2,7 +2,13 @@ from unittest import TestCase
 from mock import Mock, patch
 
 from allura.tests import TestController
-from forgesvn.tests import with_svn
+from allura.tests.decorators import with_tool
+
+
+# important to be distinct from 'test' which ForgeSVN uses, so that the tests can run in
parallel and not clobber each other
+test_project_with_repo = 'test2'
+with_svn = with_tool(test_project_with_repo, 'SVN', 'src', 'SVN')
+
 
 from forgeimporters.google.code import (
         get_repo_url,
@@ -67,7 +73,7 @@ class TestGoogleRepoImportController(TestController, TestCase):
 
     @with_svn
     def test_index(self):
-        r = self.app.get('/p/test/admin/src/_importer/')
+        r = self.app.get('/p/{}/admin/src/_importer/'.format(test_project_with_repo))
         self.assertIsNotNone(r.html.find(attrs=dict(name="gc_project_name")))
         self.assertIsNotNone(r.html.find(attrs=dict(name="mount_label")))
         self.assertIsNotNone(r.html.find(attrs=dict(name="mount_point")))
@@ -77,15 +83,16 @@ class TestGoogleRepoImportController(TestController, TestCase):
     def test_create(self, gri):
         from allura import model as M
         gri.import_tool.return_value = Mock()
-        gri.import_tool.return_value.url.return_value = '/p/test/mymount'
+        gri.import_tool.return_value.url.return_value = '/p/{}/mymount'.format(test_project_with_repo)
         params = dict(gc_project_name='poop',
                 mount_label='mylabel',
                 mount_point='mymount',
                 )
-        r = self.app.post('/p/test/admin/src/_importer/create', params,
+        r = self.app.post('/p/{}/admin/src/_importer/create'.format(test_project_with_repo),
+                params,
                 status=302)
-        project = M.Project.query.get(shortname='test')
-        self.assertEqual(r.location, 'http://localhost/p/test/mymount')
+        project = M.Project.query.get(shortname=test_project_with_repo)
+        self.assertEqual(r.location, 'http://localhost/p/{}/mymount'.format(test_project_with_repo))
         self.assertEqual(project.get_tool_data('google-code', 'project_name'),
                 'poop')
         self.assertEqual(project._id, gri.import_tool.call_args[0][0]._id)


Mime
View raw message