incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [39/50] git commit: [#6480] Fix tests to match refactors
Date Mon, 12 Aug 2013 16:41:24 GMT
[#6480] Fix tests to match refactors

Signed-off-by: Tim Van Steenburgh <tvansteenburgh@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/1d5708d0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/1d5708d0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/1d5708d0

Branch: refs/heads/cj/6422
Commit: 1d5708d07dbac80cad787c99c5d4595559c52cd6
Parents: f398a06
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Tue Aug 6 19:38:52 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Aug 7 16:47:24 2013 +0000

----------------------------------------------------------------------
 .../forgeimporters/tests/google/test_tasks.py         |  9 ---------
 ForgeImporters/forgeimporters/tests/test_base.py      | 14 +++++++++++++-
 2 files changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1d5708d0/ForgeImporters/forgeimporters/tests/google/test_tasks.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/test_tasks.py b/ForgeImporters/forgeimporters/tests/google/test_tasks.py
index 23da83f..dc7d936 100644
--- a/ForgeImporters/forgeimporters/tests/google/test_tasks.py
+++ b/ForgeImporters/forgeimporters/tests/google/test_tasks.py
@@ -31,12 +31,3 @@ def test_import_project_info(c, session, gpe):
     gpe.return_value.get_icon.assert_called_once_with()
     gpe.return_value.get_license.assert_called_once_with()
     session.flush_all.assert_called_once_with()
-
-
-@mock.patch.object(tasks.ToolImporter, 'by_name')
-@mock.patch.object(tasks, 'c')
-def test_import_tool(c, by_name):
-    c.project = mock.Mock(name='project')
-    tasks.import_tool('importer_name', 'project_name', 'mount_point', 'mount_label')
-    by_name.assert_called_once_with('importer_name')
-    by_name.return_value.import_tool.assert_called_once_with(c.project, 'project_name', 'mount_point',
'mount_label')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1d5708d0/ForgeImporters/forgeimporters/tests/test_base.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/test_base.py b/ForgeImporters/forgeimporters/tests/test_base.py
index 1558db4..18b83ac 100644
--- a/ForgeImporters/forgeimporters/tests/test_base.py
+++ b/ForgeImporters/forgeimporters/tests/test_base.py
@@ -23,6 +23,18 @@ import mock
 from .. import base
 
 
+@mock.patch.object(base.ToolImporter, 'by_name')
+@mock.patch.object(base, 'c')
+def test_import_tool(c, by_name):
+    c.project = mock.Mock(name='project')
+    c.user = mock.Mock(name='user')
+    base.import_tool('importer_name', 'project_name', 'mount_point', 'mount_label')
+    by_name.assert_called_once_with('importer_name')
+    by_name.return_value.import_tool.assert_called_once_with(c.project,
+            'project_name', user=c.user, mount_point='mount_point',
+            mount_label='mount_label')
+
+
 def ep(name, source=None, importer=None, **kw):
     mep = mock.Mock(name='mock_ep', **kw)
     mep.name = name
@@ -39,7 +51,7 @@ class TestProjectImporter(TestCase):
     @mock.patch.object(base, 'iter_entry_points')
     def test_tool_importers(self, iep):
         eps = iep.return_value = [ep('ep1', 'foo'), ep('ep2', 'bar'), ep('ep3', 'foo')]
-        pi = base.ProjectImporter()
+        pi = base.ProjectImporter(mock.Mock(name='neighborhood'))
         pi.source = 'foo'
         self.assertEqual(pi.tool_importers, {'ep1': eps[0].lv, 'ep3': eps[2].lv})
         iep.assert_called_once_with('allura.importers')


Mime
View raw message