incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [2/2] git commit: [#7103] Fixed test failure
Date Mon, 27 Jan 2014 22:23:03 GMT
[#7103] Fixed test failure

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/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/master
Commit: b15ef350f92e908556fc4fd15b265b266e5db444
Parents: 43c4bce
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Mon Jan 27 22:08:14 2014 +0000
Committer: Cory Johns <cjohns@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',


Mime
View raw message