https://bugs.webkit.org/show_bug.cgi?id=69288
Reviewed by Eric Seidel.
* Scripts/webkitpy/tool/commands/applywatchlistlocal.py: Add support for bugid.
* Scripts/webkitpy/tool/commands/applywatchlistlocal_unittest.py:
Add tests and fix an existing test because the unit tests do not go through the
normal command line processing (so the -g argument remained when we determined bug ids).
* Scripts/webkitpy/tool/commands/commandtest.py: Change the derivation to
get the assert raises regex method.
* Scripts/webkitpy/tool/commands/download.py: Fix the command help to be more unixy.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96540
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-10-03 David Levin <levin@chromium.org>
+
+ watchlist: Allow specified a bug to attach the watchlist info to.
+ https://bugs.webkit.org/show_bug.cgi?id=69288
+
+ Reviewed by Eric Seidel.
+
+ * Scripts/webkitpy/tool/commands/applywatchlistlocal.py: Add support for bugid.
+ * Scripts/webkitpy/tool/commands/applywatchlistlocal_unittest.py:
+ Add tests and fix an existing test because the unit tests do not go through the
+ normal command line processing (so the -g argument remained when we determined bug ids).
+ * Scripts/webkitpy/tool/commands/commandtest.py: Change the derivation to
+ get the assert raises regex method.
+ * Scripts/webkitpy/tool/commands/download.py: Fix the command help to be more unixy.
+
2011-10-03 Leandro Pereira <leandro@profusion.mobi>
[EFL] DRT: Add JSStringUtils.{cpp,h}
class ApplyWatchListLocal(AbstractSequencedCommand):
name = "apply-watchlist-local"
- help_text = "Applies the watchlist to local changes."
+ help_text = "Applies the watchlist to local changes"
+ argument_names = "[BUGID]"
steps = [
steps.ApplyWatchList,
]
long_help = """"Applies the watchlist to local changes.
-The results is logged but not applied to any bug. This may be used to try out a watchlist change."""
+The results is logged if a bug is no given. This may be used to try out a watchlist change."""
+
+ def _prepare_state(self, options, args, tool):
+ if len(args) > 1:
+ raise Exception("Too many arguments given: %s" % (' '.join(args)))
+ if not args:
+ return {}
+ return {
+ "bug_id": args[0],
+ }
class ApplyWatchListLocalTest(CommandsTest):
def test_args_parsing(self):
- expected_stderr = "MockWatchList: determine_cc_and_messages\n"
- self.assert_execute_outputs(ApplyWatchListLocal(), ["-g 2ed6f"], expected_stderr=expected_stderr)
+ expected_stderr = 'MockWatchList: determine_cc_and_messages\n'
+ self.assert_execute_outputs(ApplyWatchListLocal(), [''], expected_stderr=expected_stderr)
+
+ def test_args_parsing_with_bug(self):
+ expected_stderr = "MockWatchList: determine_cc_and_messages\nMOCK bug comment: bug_id=1234, cc=['levin@chromium.org']\n--- Begin comment ---\nMessage1.\n\nMessage2.\n--- End comment ---\n\n"
+ self.assert_execute_outputs(ApplyWatchListLocal(), ['1234'], expected_stderr=expected_stderr)
+
+ def test_args_parsing_with_two_bugs(self):
+ self._assertRaisesRegexp('Too many arguments given: 1234 5678', self.assert_execute_outputs, ApplyWatchListLocal(), ['1234', '5678'])
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-import unittest
-
from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.common.webkitunittest import TestCase
from webkitpy.tool.mocktool import MockOptions, MockTool
-class CommandsTest(unittest.TestCase):
+
+class CommandsTest(TestCase):
def assert_execute_outputs(self, command, args=[], expected_stdout="", expected_stderr="", expected_exception=None, options=MockOptions(), tool=MockTool()):
options.blocks = None
options.cc = 'MOCK cc'
class ApplyWatchList(AbstractPatchSequencingCommand, ProcessAttachmentsMixin):
name = "apply-watchlist"
- help_text = "Applies the watchlist to the specified attachments."
+ help_text = "Applies the watchlist to the specified attachments"
argument_names = "ATTACHMENT_ID [ATTACHMENT_IDS]"
main_steps = [
steps.CleanWorkingDirectory,