Commit e250400bae5209209bc9a154d450a249e0cd5d50
1 parent
c8acc7a4
tests: Fix args for msodde return-code test
When adapting the test a while ago, Samir forgot that this one test tested with multiple args. That was unnecessary, anyway, so removed them.
Showing
1 changed file
with
8 additions
and
14 deletions
tests/msodde/test_basic.py
| ... | ... | @@ -64,28 +64,22 @@ class TestReturnCode(unittest.TestCase): |
| 64 | 64 | Encryption) is tested. |
| 65 | 65 | """ |
| 66 | 66 | CRYPT_DIR = join(BASE_DIR, 'encrypted') |
| 67 | - ADD_ARGS = '', '-j', '-d', '-f', '-a' | |
| 68 | 67 | for filename in os.listdir(CRYPT_DIR): |
| 69 | - full_name = join(CRYPT_DIR, filename) | |
| 70 | - for args in ADD_ARGS: | |
| 71 | - self.do_test_validity(args + ' ' + full_name, True) | |
| 68 | + self.do_test_validity(join(CRYPT_DIR, filename), True) | |
| 72 | 69 | |
| 73 | - def do_test_validity(self, args, expect_error=False): | |
| 74 | - """ helper for test_valid_doc[x] """ | |
| 70 | + def do_test_validity(self, filename, expect_error=False): | |
| 71 | + """ helper for test_[in]valid_* """ | |
| 75 | 72 | have_exception = False |
| 76 | 73 | try: |
| 77 | - msodde.process_file(args, msodde.FIELD_FILTER_BLACKLIST) | |
| 74 | + msodde.process_maybe_encrypted(filename, | |
| 75 | + field_filter_mode=msodde.FIELD_FILTER_BLACKLIST) | |
| 78 | 76 | except Exception: |
| 79 | 77 | have_exception = True |
| 80 | - print_exc() | |
| 81 | - except SystemExit as exc: # sys.exit() was called | |
| 82 | - have_exception = True | |
| 83 | - if exc.code is None: | |
| 84 | - have_exception = False | |
| 78 | + # DEBUG: print_exc() | |
| 85 | 79 | |
| 86 | 80 | self.assertEqual(expect_error, have_exception, |
| 87 | - msg='Args={0}, expect={1}, exc={2}' | |
| 88 | - .format(args, expect_error, have_exception)) | |
| 81 | + msg='Filename={0}, expect={1}, exc={2}' | |
| 82 | + .format(filename, expect_error, have_exception)) | |
| 89 | 83 | |
| 90 | 84 | |
| 91 | 85 | class TestDdeLinks(unittest.TestCase): | ... | ... |