launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #08900
[Merge] lp:~gmb/launchpad/bug-16 into lp:launchpad
Graham Binns has proposed merging lp:~gmb/launchpad/bug-16 into lp:launchpad.
Requested reviews:
Graham Binns (gmb): code
For more details, see:
https://code.launchpad.net/~gmb/launchpad/bug-16/+merge/110780
This is a test merge proposal for a screencast, please ignore it.
--
https://code.launchpad.net/~gmb/launchpad/bug-16/+merge/110780
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== added file 'lib/lp/bugs/tests/test_externalbugtracker_unknown.py'
--- lib/lp/bugs/tests/test_externalbugtracker_unknown.py 1970-01-01 00:00:00 +0000
+++ lib/lp/bugs/tests/test_externalbugtracker_unknown.py 2012-06-18 11:09:22 +0000
@@ -0,0 +1,45 @@
+# Copyright 2012 Canonical Ltd. This software is licensed under the
+# GNU Affero General Public License version 3 (see the file LICENSE).
+
+"""XXX: Module docstring goes here."""
+
+__metaclass__ = type
+
+import transaction
+
+from lp.bugs.interfaces.bugtask import BugTaskStatus
+from lp.bugs.scripts.checkwatches.core import CheckwatchesMaster
+from lp.bugs.scripts.checkwatches.tests.test_remotebugupdater import (
+ StatusConvertingExternalBugTracker,
+ )
+from lp.services.log.logger import FakeLogger
+from lp.testing import TestCaseWithFactory
+from lp.testing.layers import DatabaseFunctionalLayer
+
+
+class TestRemoteBugsWithUnknownStatuses(TestCaseWithFactory):
+ """A test case for example bug #16."""
+
+ layer = DatabaseFunctionalLayer
+
+ def makeUpdater(self, remote_system=None, remote_bug_id=None,
+ bug_watch_ids=None, unmodified_remote_ids=None,
+ logger=None):
+ checkwatches_master = CheckwatchesMaster(transaction)
+ if logger is not None:
+ checkwatches_master.logger = logger
+ return checkwatches_master.remote_bug_updater_factory(
+ checkwatches_master, remote_system, remote_bug_id,
+ bug_watch_ids, unmodified_remote_ids, None)
+
+ def test_unknown_remote_status_mapped_to_unknown(self):
+ """When a remote bug with an unknown status is encountered by
+ the remote bug updater, that status is mapped to
+ BugTaskStatus.UNKNOWN.
+ """
+ updater = self.makeUpdater(
+ remote_system=StatusConvertingExternalBugTracker(),
+ remote_bug_id=42,
+ logger=FakeLogger())
+ self.assertEqual(
+ BugTaskStatus.UNKNOWN, updater._convertRemoteStatus('spam'))
=== added directory 'logs'
Follow ups