Permalink
Browse files

scripter.py: added unit test option

- not implemented yet
  • Loading branch information...
1 parent 759d89b commit 798fc84b632a328b674cdbd88e72e5ad6b59309a @dtmilano committed Apr 2, 2013
Showing with 7 additions and 3 deletions.
  1. +7 −3 AndroidViewClient/tools/scripter.py
@@ -47,10 +47,11 @@
FIND_VIEWS_WITH_TEXT = 'find-views-with-text'
USE_REGEXPS = 'use-regexps'
VERBOSE_COMMENTS = 'verbose-comments'
+UNIT_TEST = 'unit-test'
# -u,-s,-p,-v eaten by monkeyrunner
-SHORT_OPTS = 'HVIFSitrC'
+SHORT_OPTS = 'HVIFSitrCU'
LONG_OPTS = [HELP, VERBOSE, IGNORE_SECURE_DEVICE, FORCE_VIEW_SERVER_USE, DO_NOT_START_VIEW_SERVER,
- FIND_VIEWS_BY_ID, FIND_VIEWS_WITH_TEXT, USE_REGEXPS, VERBOSE_COMMENTS]
+ FIND_VIEWS_BY_ID, FIND_VIEWS_WITH_TEXT, USE_REGEXPS, VERBOSE_COMMENTS, UNIT_TEST]
ID_RE = re.compile('id/([^/]*)(/(\d+))?')
def shortAndLongOptions():
@@ -153,7 +154,7 @@ def traverseAndPrintFindViewWithText(view):
kwargs1 = {VERBOSE: False, 'ignoresecuredevice': False}
kwargs2 = {'forceviewserveruse': False, 'startviewserver': True}
-options = {USE_REGEXPS: False, VERBOSE_COMMENTS: False}
+options = {USE_REGEXPS: False, VERBOSE_COMMENTS: False, UNIT_TEST: False}
transform = traverseAndPrintFindViewById
for o, a in opts:
o = o.strip('-')
@@ -175,6 +176,9 @@ def traverseAndPrintFindViewWithText(view):
options[USE_REGEXPS] = True
elif o in ['C', VERBOSE_COMMENTS]:
options[VERBOSE_COMMENTS] = True
+ elif o in ['U', UNIT_TEST]:
+ warnings.warn('Not implemented yet: %s' % o)
+ options[UNIT_TEST] = True
device, serialno = ViewClient.connectToDeviceOrExit(**kwargs1)
vc = ViewClient(device, serialno, **kwargs2)

0 comments on commit 798fc84

Please sign in to comment.