diff options
| author | jvoisin | 2012-12-13 22:40:31 +0100 |
|---|---|---|
| committer | jvoisin | 2012-12-13 22:40:31 +0100 |
| commit | ffcb08763dcdaeef0caabc3fcb4d1442fce404ef (patch) | |
| tree | 2e8057e8e59e99df1a4f6bbf6ae0e1d0b8f837f6 /test/test.py | |
| parent | 614b07d5166a1718ac4d492384490d33c4087f49 (diff) | |
| parent | dae41c8e7d2cfce4e7f6a6a2bd27e0c018cd6a60 (diff) | |
Merge branch 'test_suite'
Diffstat (limited to 'test/test.py')
| -rw-r--r-- | test/test.py | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/test/test.py b/test/test.py index f09e1c5..675c4f9 100644 --- a/test/test.py +++ b/test/test.py | |||
| @@ -14,7 +14,6 @@ import glob | |||
| 14 | import tempfile | 14 | import tempfile |
| 15 | import unittest | 15 | import unittest |
| 16 | import subprocess | 16 | import subprocess |
| 17 | import sys | ||
| 18 | 17 | ||
| 19 | VERBOSITY = 3 | 18 | VERBOSITY = 3 |
| 20 | 19 | ||
| @@ -29,18 +28,18 @@ try: # PDF render processing | |||
| 29 | import poppler | 28 | import poppler |
| 30 | import cairo | 29 | import cairo |
| 31 | import pdfrw | 30 | import pdfrw |
| 32 | except: | 31 | except ImportError: |
| 33 | FILE_LIST.remove(('clean é.pdf', 'dirty é.pdf')) | 32 | FILE_LIST.remove(('clean é.pdf', 'dirty é.pdf')) |
| 34 | 33 | ||
| 35 | try: # python-mutagen : audio file format | 34 | try: # python-mutagen : audio file format |
| 36 | import mutagen | 35 | import mutagen |
| 37 | except: | 36 | except ImportError: |
| 38 | pass # since wr don't have any ogg for now | 37 | pass # since wr don't have any ogg for now |
| 39 | #FILE_LIST.remove(('clean.ogg', 'dirty.ogg')) | 38 | #FILE_LIST.remove(('clean.ogg', 'dirty.ogg')) |
| 40 | 39 | ||
| 41 | try: # file format exclusively managed by exiftool | 40 | try: # file format exclusively managed by exiftool |
| 42 | subprocess.Popen('exiftool', stdout=open('/dev/null')) | 41 | subprocess.Popen('exiftool', stdout=open('/dev/null')) |
| 43 | except: | 42 | except OSError: |
| 44 | pass # None for now | 43 | pass # None for now |
| 45 | 44 | ||
| 46 | 45 | ||
| @@ -68,18 +67,12 @@ class MATTest(unittest.TestCase): | |||
| 68 | shutil.rmtree(self.tmpdir) | 67 | shutil.rmtree(self.tmpdir) |
| 69 | 68 | ||
| 70 | 69 | ||
| 71 | def main(): | 70 | if __name__ == '__main__': |
| 72 | import clitest | 71 | import clitest |
| 73 | import libtest | 72 | import libtest |
| 74 | 73 | ||
| 75 | failed_tests = 0 | 74 | SUITE = unittest.TestSuite() |
| 76 | 75 | SUITE.addTests(clitest.get_tests()) | |
| 77 | print('Running cli related tests:\n') | 76 | SUITE.addTests(libtest.get_tests()) |
| 78 | failed_tests += clitest.main() | ||
| 79 | print('\nRunning library related tests:\n') | ||
| 80 | failed_tests += libtest.main() | ||
| 81 | print('\nTotal failed tests: ' + str(failed_tests)) | ||
| 82 | return failed_tests | ||
| 83 | 77 | ||
| 84 | if __name__ == '__main__': | 78 | unittest.TextTestRunner(verbosity=VERBOSITY).run(SUITE) |
| 85 | sys.exit(main()) | ||
