← Back to team overview

phatch-dev team mailing list archive

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

 

Nadia Alramli has proposed merging lp:~nadiana/phatch/acceptance_test_pep8 into lp:phatch.

    Requested reviews:
    stani (stani)


Fixed pep8 errors
-- 
https://code.launchpad.net/~nadiana/phatch/acceptance_test_pep8/+merge/20290
Your team Phatch Developers is subscribed to branch lp:phatch.
=== modified file 'tests/run_acceptance_test.py'
--- tests/run_acceptance_test.py	2010-02-27 12:59:47 +0000
+++ tests/run_acceptance_test.py	2010-02-28 02:00:32 +0000
@@ -30,6 +30,7 @@
 
 report = logging.getLogger('report')
 
+
 def clean():
     """Clean generated files from previous run"""
     utils.remove_path(options.output)
@@ -38,6 +39,7 @@
     utils.create_path(options.output)
     utils.create_path(config.OUT_ACTIONLISTS_PATH)
 
+
 def set_logger(log_path):
     """Setup logging"""
     logging.basicConfig(
@@ -55,6 +57,7 @@
     report_handler = logging.FileHandler(options.report, mode='w')
     report.addHandler(report_handler)
 
+
 if __name__ == '__main__':
     # Option parser
     parser = optparse.OptionParser()
@@ -136,8 +139,9 @@
     )
     options, args = parser.parse_args()
     if not options.no_execute and not os.path.exists(options.input):
+        msg = 'The input directory "%s" is empty or doesn\'t exist'
         logging.error(
-            'The input directory "%s" is empty or doesn\'t exist' % options.input,
+            msg % options.input,
         )
         sys.exit(1)
     choices_function = None
@@ -154,14 +158,12 @@
     all_actions = [
         action
         for name, action in phatchtools.get_actions().iteritems()
-        if name not in config.DISABLE_ACTIONS
-    ]
+        if name not in config.DISABLE_ACTIONS]
     processing_actions = [
         action
         for name, action in phatchtools.get_actions().iteritems()
         if name not in config.DISABLE_ACTIONS
-        and name not in actions_by_tag['metadata']
-    ]
+        and name not in actions_by_tag['metadata']]
     metadata_actions = actions_by_tag['metadata'].values()
     if options.tag == 'library':
         phatchtools.generate_library_actionlists(options.output)
@@ -216,7 +218,9 @@
             )
             choices_function = phatchtools.extended_choices
         else:
-            actionlists = phatchtools.minimal_actionlists(all_actions, save_action)
+            actionlists = phatchtools.minimal_actionlists(
+                all_actions, save_action,
+            )
         phatchtools.generate_actionlists(
             options.output,
             actionlists,
@@ -229,7 +233,9 @@
             )
         phatchtools.generate_library_actionlists(options.output)
     if not options.no_execute:
-        errors = phatchtools.execute_actionlists(options.input, options=options.options)
+        errors = phatchtools.execute_actionlists(
+            options.input, options=options.options,
+        )
         if errors:
             report.info('Number of errors: %s' % len(errors))
             report.info('Errors:\n\t%s' % '\n\t'.join(errors))
@@ -241,17 +247,18 @@
         mismatch = []
         output_files = [
             image
-            for image in os.listdir(options.output)
-        ]
+            for image in os.listdir(options.output)]
         for image in output_files:
             path1 = os.path.join(options.compare, image)
             if os.path.exists(path1):
                 path2 = os.path.join(options.output, image)
                 if not utils.compare(path1, path2):
                     result = utils.analyze(path1, path2)
-                    report.info('Mismatch: %s\nreason: %s' % (image, result['reason']))
+                    report.info(
+                        'Mismatch: %s\nreason: %s' % (image, result['reason']))
                     if 'diff' in result:
-                        result['diff'].save(os.path.join(config.OUT_DIFF, image) + '.png')
+                        result['diff'].save(
+                            os.path.join(config.OUT_DIFF, image) + '.png')
                     mismatch.append(image)
             else:
                 new.append(image)


Follow ups