You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2014/02/03 23:53:30 UTC

[04/15] git commit: [#7103] Fixed test failure

[#7103] Fixed test failure

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

Branch: refs/heads/cj/7085
Commit: b15ef350f92e908556fc4fd15b265b266e5db444
Parents: 43c4bce
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Mon Jan 27 22:08:14 2014 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Mon Jan 27 22:08:14 2014 +0000

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


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b15ef350/ForgeImporters/forgeimporters/tests/test_base.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/test_base.py b/ForgeImporters/forgeimporters/tests/test_base.py
index c5aeb68..e93a6b1 100644
--- a/ForgeImporters/forgeimporters/tests/test_base.py
+++ b/ForgeImporters/forgeimporters/tests/test_base.py
@@ -45,10 +45,12 @@ class TestProjectExtractor(TestCase):
         self.assertEqual(r, urlopen.return_value)
 
 
+@mock.patch.object(base, 'datetime')
+@mock.patch.object(base, 'M')
 @mock.patch.object(base, 'object_from_path')
 @mock.patch.object(base, 'c')
 @mock.patch.object(base, 'g')
-def test_import_tool(g, c, object_from_path):
+def test_import_tool(g, c, object_from_path, M, _datetime):
     c.project = mock.Mock(name='project')
     c.user = mock.Mock(name='user')
     object_from_path.return_value = importer = mock.Mock()
@@ -58,11 +60,16 @@ def test_import_tool(g, c, object_from_path):
         'forgeimporters.base.ToolImporter', project_name='project_name',
         mount_point='mount_point', mount_label='mount_label')
     app = importer.return_value.import_tool.return_value
-    importer.return_value.import_tool.assert_called_once_with(c.project,
-                                                              c.user, project_name='project_name', mount_point='mount_point',
-                                                              mount_label='mount_label')
-    g.director.create_activity.assert_called_once_with(c.user, "imported",
-                                                       app.config, related_nodes=[c.project])
+    importer.return_value.import_tool.assert_called_once_with(
+        c.project,
+        c.user, project_name='project_name', mount_point='mount_point',
+        mount_label='mount_label')
+    M.Project.query.update.assert_called_once_with(
+        {'_id': c.project._id},
+        {'$set': {'last_updated': _datetime.utcnow()}})
+    g.director.create_activity.assert_called_once_with(
+        c.user, "imported",
+        app.config, related_nodes=[c.project])
     g.post_event.assert_called_once_with(
         'import_tool_task_succeeded',
         'source',