incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [05/50] git commit: [#6541] Override url in AuditLog on tool import
Date Tue, 17 Sep 2013 19:57:32 GMT
[#6541] Override url in AuditLog on tool import

Signed-off-by: Cory Johns <cjohns@slashdotmedia.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/89cfb5ab
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/89cfb5ab
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/89cfb5ab

Branch: refs/heads/cj/6422
Commit: 89cfb5abd76efb0e8ae999621dc377d222b0c8a1
Parents: 44b2a36
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Fri Sep 6 18:17:05 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon Sep 9 20:27:30 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/google/code.py               | 2 +-
 ForgeImporters/forgeimporters/google/tests/test_code.py    | 3 ++-
 ForgeImporters/forgeimporters/google/tracker.py            | 1 +
 ForgeImporters/forgeimporters/tests/google/test_tracker.py | 3 ++-
 ForgeImporters/forgeimporters/trac/tests/test_tickets.py   | 3 ++-
 ForgeImporters/forgeimporters/trac/tickets.py              | 2 +-
 6 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/89cfb5ab/ForgeImporters/forgeimporters/google/code.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/code.py b/ForgeImporters/forgeimporters/google/code.py
index c5f34cd..134ecb6 100644
--- a/ForgeImporters/forgeimporters/google/code.py
+++ b/ForgeImporters/forgeimporters/google/code.py
@@ -178,6 +178,6 @@ class GoogleRepoImporter(ToolImporter):
                 'import tool %s from %s on %s' % (
                     app.config.options.mount_point,
                     project_name, self.source,
-                ), project=project, user=user)
+                ), project=project, user=user, url=app.url)
         g.post_event('project_updated')
         return app

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/89cfb5ab/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 4028076..806a004 100644
--- a/ForgeImporters/forgeimporters/google/tests/test_code.py
+++ b/ForgeImporters/forgeimporters/google/tests/test_code.py
@@ -67,6 +67,7 @@ class TestGoogleRepoImporter(TestCase):
         u = Mock(name='c.user')
         app = p.install_app.return_value
         app.config.options.mount_point = 'code'
+        app.url = 'foo'
         GoogleRepoImporter().import_tool(p, u, project_name='project_name')
         get_repo_url.assert_called_once_with('project_name', 'git')
         p.install_app.assert_called_once_with('Git',
@@ -80,7 +81,7 @@ class TestGoogleRepoImporter(TestCase):
             )
         M.AuditLog.log.assert_called_once_with(
                 'import tool code from project_name on Google Code',
-                project=p, user=u)
+                project=p, user=u, url='foo')
         g.post_event.assert_called_once_with('project_updated')
 
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/89cfb5ab/ForgeImporters/forgeimporters/google/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/tracker.py b/ForgeImporters/forgeimporters/google/tracker.py
index cf6067e..9c259dd 100644
--- a/ForgeImporters/forgeimporters/google/tracker.py
+++ b/ForgeImporters/forgeimporters/google/tracker.py
@@ -147,6 +147,7 @@ class GoogleCodeTrackerImporter(ToolImporter):
                         ),
                     project=project,
                     user=user,
+                    url=app.url,
                 )
             g.post_event('project_updated')
             app.globals.invalidate_bin_counts()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/89cfb5ab/ForgeImporters/forgeimporters/tests/google/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/test_tracker.py b/ForgeImporters/forgeimporters/tests/google/test_tracker.py
index 8f434df..d795bab 100644
--- a/ForgeImporters/forgeimporters/tests/google/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/google/test_tracker.py
@@ -48,6 +48,7 @@ class TestTrackerImporter(TestCase):
                 'project_name': 'project_name',
             }
         app.config.options.get = lambda *a: getattr(app.config.options, *a)
+        app.url = 'foo'
         issues = gpe.iter_issues.return_value = [(50, mock.Mock()), (100, mock.Mock())]
         tickets = TM.Ticket.side_effect = [mock.Mock(), mock.Mock()]
 
@@ -91,7 +92,7 @@ class TestTrackerImporter(TestCase):
         self.assertEqual(app.globals.last_ticket_num, 100)
         M.AuditLog.log.assert_called_once_with(
                 'import tool mount_point from project_name on Google Code',
-                project=project, user=user)
+                project=project, user=user, url='foo')
         g.post_event.assert_called_once_with('project_updated')
         app.globals.invalidate_bin_counts.assert_called_once_with()
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/89cfb5ab/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/trac/tests/test_tickets.py b/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
index 2e0c199..92e7854 100644
--- a/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
+++ b/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
@@ -48,6 +48,7 @@ class TestTracTicketImporter(TestCase):
         app = Mock(name='ForgeTrackerApp')
         app.config.options.mount_point = 'bugs'
         app.config.options.get = lambda *a: getattr(app.config.options, *a)
+        app.url = 'foo'
         project = Mock(name='Project', shortname='myproject')
         project.install_app.return_value = app
         user = Mock(name='User', _id='id')
@@ -78,7 +79,7 @@ class TestTracTicketImporter(TestCase):
                 validate=False)
         AuditLog.log.assert_called_once_with(
                 'import tool bugs from http://example.com/trac/url/',
-                project=project, user=user)
+                project=project, user=user, url='foo')
         g.post_event.assert_called_once_with('project_updated')
 
     @patch('forgeimporters.trac.tickets.session')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/89cfb5ab/ForgeImporters/forgeimporters/trac/tickets.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/trac/tickets.py b/ForgeImporters/forgeimporters/trac/tickets.py
index e5238e3..9e4f493 100644
--- a/ForgeImporters/forgeimporters/trac/tickets.py
+++ b/ForgeImporters/forgeimporters/trac/tickets.py
@@ -141,7 +141,7 @@ class TracTicketImporter(ToolImporter):
                         app.config.options.mount_point, 
                         trac_url, 
                     ), 
-                project=project, user=user, 
+                project=project, user=user, url=app.url,
             ) 
             g.post_event('project_updated')
             return app


Mime
View raw message