diff options
| author | jvoisin | 2015-07-25 17:14:23 +0200 |
|---|---|---|
| committer | jvoisin | 2015-07-25 17:14:23 +0200 |
| commit | 6ba3e3f20d7d52895bc44f9fc35b068cfce47133 (patch) | |
| tree | 15df2aca17d56d941c6376ef729e0c1fea4c396f /test/test.py | |
| parent | 85e6279d16af063e5150c7cf4bd491185b8ae788 (diff) | |
_MASSIVE_ pep8 revamp
Thank you so much PyCharm
Diffstat (limited to '')
| -rw-r--r-- | test/test.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/test/test.py b/test/test.py index ed68e13..40cbf0c 100644 --- a/test/test.py +++ b/test/test.py | |||
| @@ -1,13 +1,12 @@ | |||
| 1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
| 2 | # -*- coding: utf-8 -* | 2 | # -*- coding: utf-8 -* |
| 3 | 3 | ||
| 4 | ''' | 4 | """ |
| 5 | Class for the testing suite : | 5 | Class for the testing suite : |
| 6 | - get the list of all test files | 6 | - get the list of all test files |
| 7 | - create a copy of them on start | 7 | - create a copy of them on start |
| 8 | - remove the copy on end | 8 | - remove the copy on end |
| 9 | ''' | 9 | """ |
| 10 | |||
| 11 | 10 | ||
| 12 | import shutil | 11 | import shutil |
| 13 | import os | 12 | import os |
| @@ -42,27 +41,28 @@ except ImportError: | |||
| 42 | 41 | ||
| 43 | 42 | ||
| 44 | class MATTest(unittest.TestCase): | 43 | class MATTest(unittest.TestCase): |
| 45 | ''' | 44 | """ |
| 46 | Parent class of all test-functions | 45 | Parent class of all test-functions |
| 47 | ''' | 46 | """ |
| 47 | |||
| 48 | def setUp(self): | 48 | def setUp(self): |
| 49 | ''' | 49 | """ |
| 50 | Create working copy of the clean and the dirty file in the TMP dir | 50 | Create working copy of the clean and the dirty file in the TMP dir |
| 51 | ''' | 51 | """ |
| 52 | self.file_list = [] | 52 | self.file_list = [] |
| 53 | self.tmpdir = tempfile.mkdtemp() | 53 | self.tmpdir = tempfile.mkdtemp() |
| 54 | 54 | ||
| 55 | for clean, dirty in FILE_LIST: | 55 | for clean_file, dirty_file in FILE_LIST: |
| 56 | clean_dir = os.path.join(self.tmpdir, clean) | 56 | clean_dir = os.path.join(self.tmpdir, clean_file) |
| 57 | dirty_dir = os.path.join(self.tmpdir, dirty) | 57 | dirty_dir = os.path.join(self.tmpdir, dirty_file) |
| 58 | shutil.copy2(clean, clean_dir) | 58 | shutil.copy2(clean_file, clean_dir) |
| 59 | shutil.copy2(dirty, dirty_dir) | 59 | shutil.copy2(dirty_file, dirty_dir) |
| 60 | self.file_list.append((clean_dir, dirty_dir)) | 60 | self.file_list.append((clean_dir, dirty_dir)) |
| 61 | 61 | ||
| 62 | def tearDown(self): | 62 | def tearDown(self): |
| 63 | ''' | 63 | """ |
| 64 | Remove the tmp folder | 64 | Remove the tmp folder |
| 65 | ''' | 65 | """ |
| 66 | for root, dirs, files in os.walk(self.tmpdir): | 66 | for root, dirs, files in os.walk(self.tmpdir): |
| 67 | for d in dirs + files: | 67 | for d in dirs + files: |
| 68 | os.chmod(os.path.join(root, d), 0o777) | 68 | os.chmod(os.path.join(root, d), 0o777) |
| @@ -78,4 +78,4 @@ if __name__ == '__main__': | |||
| 78 | SUITE.addTests(libtest.get_tests()) | 78 | SUITE.addTests(libtest.get_tests()) |
| 79 | 79 | ||
| 80 | ret = unittest.TextTestRunner(verbosity=VERBOSITY).run(SUITE).wasSuccessful() | 80 | ret = unittest.TextTestRunner(verbosity=VERBOSITY).run(SUITE).wasSuccessful() |
| 81 | sys.exit(ret == False) | 81 | sys.exit(ret is False) |
