From 27f089ea9ce86bf82da9f63f01304a3f6828d9b2 Mon Sep 17 00:00:00 2001 From: Chris Churas Date: Fri, 23 Jun 2017 16:01:04 -0700 Subject: [PATCH] style fixes to make flake8 happy --- chmutil/image.py | 1 - tests/test_createchmjob.py | 3 ++- tests/test_image_funcs.py | 10 +++++----- tests/test_imagestats.py | 1 - tests/test_tasksummaryfactory.py | 5 +++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/chmutil/image.py b/chmutil/image.py index c9963f6..db81ca7 100644 --- a/chmutil/image.py +++ b/chmutil/image.py @@ -450,4 +450,3 @@ def get_total_pixels(self): :returns: total number of pixels ie W x H x # images """ return self._total_pixels - diff --git a/tests/test_createchmjob.py b/tests/test_createchmjob.py index 65ca841..212c3d9 100644 --- a/tests/test_createchmjob.py +++ b/tests/test_createchmjob.py @@ -129,7 +129,8 @@ def test_create_chm_job_success_withgentifs_set(self): chmconfig = fac.get_chmconfig(skip_loading_mergeconfig=False) mcon = chmconfig.get_merge_config() self.assertEqual(mcon.getboolean(CHMJobCreator.CONFIG_DEFAULT, - CHMJobCreator.MERGE_GENTIFS), True) + CHMJobCreator.MERGE_GENTIFS), + True) finally: shutil.rmtree(temp_dir) diff --git a/tests/test_image_funcs.py b/tests/test_image_funcs.py index 816f712..668389b 100644 --- a/tests/test_image_funcs.py +++ b/tests/test_image_funcs.py @@ -91,14 +91,14 @@ def test_get_image_path_with_longest_number_keysort(self): func = core.get_longest_sequence_of_numbers_in_string # no files res = image.get_image_path_list(temp_dir, None, - keysortfunc=func) + keysortfunc=func) self.assertEqual(len(res), 0) # one file onefile = os.path.join(temp_dir, 'foo.2345.txt') open(onefile, 'a').close() res = image.get_image_path_list(temp_dir, None, - keysortfunc=func) + keysortfunc=func) self.assertEqual(len(res), 1) self.assertTrue(onefile in res) @@ -109,7 +109,7 @@ def test_get_image_path_with_longest_number_keysort(self): adir = os.path.join(temp_dir, 'somedir.png') os.makedirs(adir, mode=0o775) res = image.get_image_path_list(temp_dir, None, - keysortfunc=func) + keysortfunc=func) self.assertEqual(len(res), 2) self.assertTrue(onefile in res) self.assertTrue(twofile in res) @@ -117,7 +117,7 @@ def test_get_image_path_with_longest_number_keysort(self): # suffix set to .png res = image.get_image_path_list(temp_dir, '.png', - keysortfunc=func) + keysortfunc=func) self.assertEqual(len(res), 1) self.assertTrue(twofile in res) @@ -134,7 +134,7 @@ def test_get_image_path_with_longest_number_keysort(self): open(af, 'a').close() res = image.get_image_path_list(temp_dir, '.png', - keysortfunc=func) + keysortfunc=func) self.assertEqual(len(res), 1000) finally: shutil.rmtree(temp_dir) diff --git a/tests/test_imagestats.py b/tests/test_imagestats.py index 3fe4cdf..6c6a59d 100644 --- a/tests/test_imagestats.py +++ b/tests/test_imagestats.py @@ -38,6 +38,5 @@ def test_constructor(self): self.assertEqual(im_stats.get_size_in_bytes(), 123) - if __name__ == '__main__': unittest.main() diff --git a/tests/test_tasksummaryfactory.py b/tests/test_tasksummaryfactory.py index 3644063..96fc2b6 100644 --- a/tests/test_tasksummaryfactory.py +++ b/tests/test_tasksummaryfactory.py @@ -381,7 +381,7 @@ def test_get_image_stats_summary_output_compute_false(self): def test_get_image_stats_summary_output_compute_true_but_invalid_dir(self): temp_dir = tempfile.mkdtemp() try: - con = CHMConfig(os.path.join(temp_dir,'images'), + con = CHMConfig(os.path.join(temp_dir, 'images'), './model', './outdir', '500x500', '20x20') cfig = configparser.ConfigParser() cfig.add_section('1') @@ -456,7 +456,8 @@ def test_get_image_stats_summary_output_compute_true_one_image(self): self.assertEqual(isum.get_image_count(), 1) self.assertEqual(isum.get_total_pixels(), 100) self.assertEqual(isum.get_total_size_of_images_in_bytes(), expsize) - self.assertEqual(isum.get_image_dimensions_as_dict(), {(10,10): 1}) + self.assertEqual(isum.get_image_dimensions_as_dict(), + {(10, 10): 1}) finally: shutil.rmtree(temp_dir)