Mercurial > hg > configuration
annotate tests/example.py @ 119:f103c93690fb
make more APIish
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 04 Dec 2012 15:37:34 -0800 |
parents | c530f6265deb |
children |
rev | line source |
---|---|
23 | 1 #!/usr/bin/env python |
2 | |
0 | 3 from configuration import Configuration |
4 | |
5 class ExampleConfiguration(Configuration): | |
6 """example configuration instance""" | |
3 | 7 options = { |
8 'activeTests': {'type': list, | |
9 'required': "No tests specified; please specify --activeTests", | |
10 'help': 'Specify tests to run', | |
11 'flags': ['-a', '--activeTests']}, # command line flags | |
12 'title': {'help': 'talos run title'}, | |
13 'browser_path': {'required': True, | |
14 'flags': ['-e', '--executablePath'], | |
19
cadc9514f60a
we have a legitimately failing test!
Jeff Hammel <jhammel@mozilla.com>
parents:
14
diff
changeset
|
15 'help': 'path to firefox'}, |
cadc9514f60a
we have a legitimately failing test!
Jeff Hammel <jhammel@mozilla.com>
parents:
14
diff
changeset
|
16 'develop': {'help': "useful for running tests on a developer machine. Creates a local webserver and doesn't upload to the graph servers.", |
23 | 17 'type': bool}, |
69
92c11cd1d27e
now we check for types more betterer
Jeff Hammel <jhammel@mozilla.com>
parents:
64
diff
changeset
|
18 'test_timeout': {'help': "Time to wait for the browser to output to the log file", |
22
f6c3f91af7f2
add something with a default value
Jeff Hammel <jhammel@mozilla.com>
parents:
19
diff
changeset
|
19 'default': 1200}, |
102
c530f6265deb
allow extensible configuration; also start using deepcopy heavily since otherwise you have artefacts
Jeff Hammel <jhammel@mozilla.com>
parents:
82
diff
changeset
|
20 'preferences': {'help': 'profile preferences', |
c530f6265deb
allow extensible configuration; also start using deepcopy heavily since otherwise you have artefacts
Jeff Hammel <jhammel@mozilla.com>
parents:
82
diff
changeset
|
21 'default': {'browser.bookmarks.max_backups': 0, |
c530f6265deb
allow extensible configuration; also start using deepcopy heavily since otherwise you have artefacts
Jeff Hammel <jhammel@mozilla.com>
parents:
82
diff
changeset
|
22 'browser.cache.disk.smart_size.enabled': False}, |
82 | 23 'flags': ['-p', '--pref']} |
3 | 24 } |
102
c530f6265deb
allow extensible configuration; also start using deepcopy heavily since otherwise you have artefacts
Jeff Hammel <jhammel@mozilla.com>
parents:
82
diff
changeset
|
25 extend = set(['preferences']) |
3 | 26 |
27 if __name__ == '__main__': | |
64 | 28 from pprint import pprint |
29 options, args = ExampleConfiguration().parse_args() | |
30 pprint(options.__dict__) |