Skip to content

Commit

Permalink
tests: speed up longest test
Browse files Browse the repository at this point in the history
On my test VM this reduces test time for this one test from 33s to
10s
  • Loading branch information
christian-intra2net committed Feb 16, 2022
1 parent f899797 commit b8ba847
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/olevba/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ def test_rtf_behaviour(self):

def test_crypt_return(self):
"""
Tests that encrypted files give a certain return code.
Test that encrypted files give a certain return code.
Currently, only the encryption applied by Office 2010 (CryptoApi RC4
Encryption) is tested.
"""
CRYPT_DIR = join(DATA_BASE_DIR, 'encrypted')
CRYPT_RETURN_CODE = 9
ADD_ARGS = [], ['-d', ], ['-a', ], ['-j', ], ['-t', ]
ADD_ARGS = [], ['-d', ], ['-a', ], ['-j', ], ['-t', ] # only 1st file
EXCEPTIONS = ['autostart-encrypt-standardpassword.xls', # These ...
'autostart-encrypt-standardpassword.xlsm', # files ...
'autostart-encrypt-standardpassword.xlsb', # are ...
Expand All @@ -103,6 +103,10 @@ def test_crypt_return(self):
msg='Wrong return code {} for args {}'\
.format(ret_code, args + [filename, ]))

# test only first file with all arg combinations, others just
# without arg (test takes too long otherwise
ADD_ARGS = ([], )


# just in case somebody calls this file as a script
if __name__ == '__main__':
Expand Down

0 comments on commit b8ba847

Please sign in to comment.