incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject git commit: [#5022] Fixed failing test due to new arg
Date Mon, 01 Oct 2012 17:17:30 GMT
Updated Branches:
  refs/heads/cj/5022 bd92ad692 -> 56ed83872


[#5022] Fixed failing test due to new arg

Signed-off-by: Cory Johns <johnsca@geek.net>


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

Branch: refs/heads/cj/5022
Commit: 56ed83872b95f42833f00bf10e2faeefe4e03884
Parents: bd92ad6
Author: Cory Johns <johnsca@geek.net>
Authored: Mon Oct 1 17:15:15 2012 +0000
Committer: Cory Johns <johnsca@geek.net>
Committed: Mon Oct 1 17:15:15 2012 +0000

----------------------------------------------------------------------
 Allura/allura/tests/test_tasks.py |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/56ed8387/Allura/allura/tests/test_tasks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_tasks.py b/Allura/allura/tests/test_tasks.py
index 580b7f0..1c52478 100644
--- a/Allura/allura/tests/test_tasks.py
+++ b/Allura/allura/tests/test_tasks.py
@@ -6,6 +6,9 @@ import unittest
 from base64 import b64encode
 
 import mock
+import pylons
+pylons.c = pylons.tmpl_context
+pylons.g = pylons.app_globals
 from pylons import c, g
 from datadiff.tools import assert_equal
 from nose.tools import assert_in
@@ -205,10 +208,11 @@ class TestRepoTasks(unittest.TestCase):
     def test_clone(self):
         ns = M.Notification.query.find().count()
         with mock.patch.object(c.app.repo, 'init_as_clone') as f:
-            repo_tasks.clone('foo', 'bar', 'baz')
-            M.main_orm_session.flush()
-            f.assert_called_with('foo', 'bar', 'baz')
-            assert ns + 1 == M.Notification.query.find().count()
+            with mock.patch.object(mail_tasks.smtp_client, '_client') as _client:
+                repo_tasks.clone('foo', 'bar', 'baz')
+                M.main_orm_session.flush()
+                f.assert_called_with('foo', 'bar', 'baz', False)
+                assert ns + 1 == M.Notification.query.find().count()
 
     def test_refresh(self):
         with mock.patch.object(c.app.repo, 'refresh') as f:


Mime
View raw message