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 2013/08/20 23:41:45 UTC

[3/3] git commit: [#6464] Fixed bin counts for GC Tracker importer

[#6464] Fixed bin counts for GC Tracker importer

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/b7dbd2fc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/b7dbd2fc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/b7dbd2fc

Branch: refs/heads/cj/6464
Commit: b7dbd2fcf17d233faf496f73d0a890064cc42833
Parents: fa955f4
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue Aug 20 21:41:00 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Aug 20 21:41:00 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/google/tracker.py                   | 1 +
 .../forgeimporters/tests/google/functional/test_tracker.py        | 3 ++-
 ForgeImporters/forgeimporters/tests/google/test_tracker.py        | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b7dbd2fc/ForgeImporters/forgeimporters/google/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/tracker.py b/ForgeImporters/forgeimporters/google/tracker.py
index e96678f..8b1747f 100644
--- a/ForgeImporters/forgeimporters/google/tracker.py
+++ b/ForgeImporters/forgeimporters/google/tracker.py
@@ -75,6 +75,7 @@ class GoogleCodeTrackerImporter(ToolImporter):
                 app.globals.last_ticket_num = self.max_ticket_num
                 ThreadLocalORMSession.flush_all()
             g.post_event('project_updated')
+            app.globals.invalidate_bin_counts()
             return app
         finally:
             M.session.artifact_orm_session._get().skip_mod_date = False

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b7dbd2fc/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py b/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
index 813a8b0..184f7fd 100644
--- a/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
@@ -49,7 +49,8 @@ class TestGCTrackerImporter(TestCase):
     def _make_ticket(self, issue, issue_id=1):
         self.assertIsNone(self.project.app_instance('test-issue'))
         with mock.patch.object(base.h, 'urlopen') as urlopen,\
-             mock.patch.object(google.tracker, 'GoogleCodeProjectExtractor') as GPE:
+             mock.patch.object(google.tracker, 'GoogleCodeProjectExtractor') as GPE,\
+             mock.patch('forgetracker.tasks.update_bin_counts') as ubc:
             urlopen.side_effect = lambda req, **kw: mock.Mock(read=req.get_full_url)
             GPE.iter_issues.return_value = [(issue_id, issue)]
             gti = google.tracker.GoogleCodeTrackerImporter()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b7dbd2fc/ForgeImporters/forgeimporters/tests/google/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/test_tracker.py b/ForgeImporters/forgeimporters/tests/google/test_tracker.py
index 48ddc44..4a7c28f 100644
--- a/ForgeImporters/forgeimporters/tests/google/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/google/test_tracker.py
@@ -77,6 +77,7 @@ class TestTrackerImporter(TestCase):
             ])
         self.assertEqual(app.globals.last_ticket_num, 100)
         g.post_event.assert_called_once_with('project_updated')
+        app.globals.invalidate_bin_counts.assert_called_once_with()
 
     def test_custom_fields(self):
         importer = tracker.GoogleCodeTrackerImporter()