Merge lp:~nadiana/phatch/acceptance_test_pep8 into lp:phatch

Proposed by Nadia Alramli
Status: Merged
Merged at revision: not available
Proposed branch: lp:~nadiana/phatch/acceptance_test_pep8
Merge into: lp:phatch
Diff against target: 100 lines (+18/-11)
1 file modified
tests/run_acceptance_test.py (+18/-11)
To merge this branch: bzr merge lp:~nadiana/phatch/acceptance_test_pep8
Reviewer Review Type Date Requested Status
Stani Pending
Review via email: mp+20290@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Nadia Alramli (nadiana) wrote :

Fixed pep8 errors

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/run_acceptance_test.py'
2--- tests/run_acceptance_test.py 2010-02-27 12:59:47 +0000
3+++ tests/run_acceptance_test.py 2010-02-28 02:00:33 +0000
4@@ -30,6 +30,7 @@
5
6 report = logging.getLogger('report')
7
8+
9 def clean():
10 """Clean generated files from previous run"""
11 utils.remove_path(options.output)
12@@ -38,6 +39,7 @@
13 utils.create_path(options.output)
14 utils.create_path(config.OUT_ACTIONLISTS_PATH)
15
16+
17 def set_logger(log_path):
18 """Setup logging"""
19 logging.basicConfig(
20@@ -55,6 +57,7 @@
21 report_handler = logging.FileHandler(options.report, mode='w')
22 report.addHandler(report_handler)
23
24+
25 if __name__ == '__main__':
26 # Option parser
27 parser = optparse.OptionParser()
28@@ -136,8 +139,9 @@
29 )
30 options, args = parser.parse_args()
31 if not options.no_execute and not os.path.exists(options.input):
32+ msg = 'The input directory "%s" is empty or doesn\'t exist'
33 logging.error(
34- 'The input directory "%s" is empty or doesn\'t exist' % options.input,
35+ msg % options.input,
36 )
37 sys.exit(1)
38 choices_function = None
39@@ -154,14 +158,12 @@
40 all_actions = [
41 action
42 for name, action in phatchtools.get_actions().iteritems()
43- if name not in config.DISABLE_ACTIONS
44- ]
45+ if name not in config.DISABLE_ACTIONS]
46 processing_actions = [
47 action
48 for name, action in phatchtools.get_actions().iteritems()
49 if name not in config.DISABLE_ACTIONS
50- and name not in actions_by_tag['metadata']
51- ]
52+ and name not in actions_by_tag['metadata']]
53 metadata_actions = actions_by_tag['metadata'].values()
54 if options.tag == 'library':
55 phatchtools.generate_library_actionlists(options.output)
56@@ -216,7 +218,9 @@
57 )
58 choices_function = phatchtools.extended_choices
59 else:
60- actionlists = phatchtools.minimal_actionlists(all_actions, save_action)
61+ actionlists = phatchtools.minimal_actionlists(
62+ all_actions, save_action,
63+ )
64 phatchtools.generate_actionlists(
65 options.output,
66 actionlists,
67@@ -229,7 +233,9 @@
68 )
69 phatchtools.generate_library_actionlists(options.output)
70 if not options.no_execute:
71- errors = phatchtools.execute_actionlists(options.input, options=options.options)
72+ errors = phatchtools.execute_actionlists(
73+ options.input, options=options.options,
74+ )
75 if errors:
76 report.info('Number of errors: %s' % len(errors))
77 report.info('Errors:\n\t%s' % '\n\t'.join(errors))
78@@ -241,17 +247,18 @@
79 mismatch = []
80 output_files = [
81 image
82- for image in os.listdir(options.output)
83- ]
84+ for image in os.listdir(options.output)]
85 for image in output_files:
86 path1 = os.path.join(options.compare, image)
87 if os.path.exists(path1):
88 path2 = os.path.join(options.output, image)
89 if not utils.compare(path1, path2):
90 result = utils.analyze(path1, path2)
91- report.info('Mismatch: %s\nreason: %s' % (image, result['reason']))
92+ report.info(
93+ 'Mismatch: %s\nreason: %s' % (image, result['reason']))
94 if 'diff' in result:
95- result['diff'].save(os.path.join(config.OUT_DIFF, image) + '.png')
96+ result['diff'].save(
97+ os.path.join(config.OUT_DIFF, image) + '.png')
98 mismatch.append(image)
99 else:
100 new.append(image)

Subscribers

People subscribed via source and target branches

to status/vote changes: