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 2012/10/15 23:18:56 UTC

[6/7] git commit: [#4927] ticket:185 fixed test for repo refreshing task

[#4927] ticket:185 fixed test for repo refreshing task


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

Branch: refs/heads/master
Commit: fb354e5e1f40b032e329ef5dcadc8f4d66b3e172
Parents: d3b5142
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Mon Oct 8 18:34:49 2012 +0300
Committer: Cory Johns <jo...@geek.net>
Committed: Mon Oct 15 20:23:07 2012 +0000

----------------------------------------------------------------------
 Allura/allura/tests/model/test_repo.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/fb354e5e/Allura/allura/tests/model/test_repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_repo.py b/Allura/allura/tests/model/test_repo.py
index 56acdd9..1dda265 100644
--- a/Allura/allura/tests/model/test_repo.py
+++ b/Allura/allura/tests/model/test_repo.py
@@ -14,7 +14,7 @@ from ming.orm import session, ThreadLocalORMSession
 from alluratest.controller import setup_basic_test, setup_global_objects
 from allura import model as M
 from allura.lib import helpers as h
-
+import allura.tasks
 
 class _Test(unittest.TestCase):
     idgen = ( 'obj_%d' % i for i in count())
@@ -204,11 +204,11 @@ class TestRepo(_TestWithRepo):
             self.repo.refresh()
             post_event.assert_called_with(
                     'repo_refreshed', commit_number=0, new=False)
-        with mock.patch('allura.model.repository.refresh') as refresh:
-            self.repo.refresh()
-            self.repo.refresh()
-            refresh.assert_called_once()
+        with mock.patch('allura.model.repository.Repository.refresh') as refresh:
+            allura.tasks.repo_tasks.refresh.post()
+            allura.tasks.repo_tasks.refresh.post()
             M.MonQTask.run_ready()
+            refresh.assert_called_once()
         ThreadLocalORMSession.flush_all()
         notifications = M.Notification.query.find().all()
         for n in notifications: