Bug 68869 - watchlist: Change watchlistparser.py to be class based.
Summary: watchlist: Change watchlistparser.py to be class based.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Levin
URL:
Keywords:
Depends on:
Blocks: 68822
  Show dependency treegraph
 
Reported: 2011-09-26 22:57 PDT by David Levin
Modified: 2011-09-27 08:52 PDT (History)
2 users (show)

See Also:


Attachments
Patch (6.60 KB, patch)
2011-09-26 23:01 PDT, David Levin
eric: review+
levin: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Levin 2011-09-26 22:57:00 PDT
Instead of function based.
Comment 1 David Levin 2011-09-26 23:01:25 PDT
Created attachment 108790 [details]
Patch
Comment 2 Eric Seidel (no email) 2011-09-27 00:20:58 PDT
Comment on attachment 108790 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=108790&action=review

Thanks.  I've had to learn this the hard way.  Basically it becomes impossible to test static module funtions.  Adding them into a class makes it super easy to have the class hold an Executive/FileSystem/User or other mockable object if needed.

> Tools/Scripts/webkitpy/common/watchlist/watchlistparser.py:33
>  _INVALID_DEFINITION_NAME_REGEX = r'\|'

I bet you want to make these class members now too.

> Tools/Scripts/webkitpy/common/watchlist/watchlistparser_unittest.py:52
> +        watch_list_parser = WatchListParser()

You could have a setUp which allocates self.parser = WatchListParser() if you prefer.
Comment 3 David Levin 2011-09-27 08:52:06 PDT
Changed as suggested.

Committed as http://trac.webkit.org/changeset/96115.