Commit 14e6876845b5e9940bc2ceb2c31f8e4d339a2bd1
1 parent
d7ca775e
tests: tell oleid test what to expect for new samples
Showing
1 changed file
with
30 additions
and
2 deletions
tests/oleid/test_basic.py
| @@ -20,7 +20,7 @@ class TestOleIDBasic(unittest.TestCase): | @@ -20,7 +20,7 @@ class TestOleIDBasic(unittest.TestCase): | ||
| 20 | """Run all file in test-data through oleid and compare to known ouput""" | 20 | """Run all file in test-data through oleid and compare to known ouput""" |
| 21 | # this relies on order of indicators being constant, could relax that | 21 | # this relies on order of indicators being constant, could relax that |
| 22 | # Also requires that files have the correct suffixes (no rtf in doc) | 22 | # Also requires that files have the correct suffixes (no rtf in doc) |
| 23 | - NON_OLE_SUFFIXES = ('.xml', '.csv', '.rtf', '') | 23 | + NON_OLE_SUFFIXES = ('.xml', '.csv', '.rtf', '', '.odt', '.ods', '.odp') |
| 24 | NON_OLE_VALUES = (False, ) | 24 | NON_OLE_VALUES = (False, ) |
| 25 | WORD = b'Microsoft Office Word' | 25 | WORD = b'Microsoft Office Word' |
| 26 | PPT = b'Microsoft Office PowerPoint' | 26 | PPT = b'Microsoft Office PowerPoint' |
| @@ -121,6 +121,33 @@ class TestOleIDBasic(unittest.TestCase): | @@ -121,6 +121,33 @@ class TestOleIDBasic(unittest.TestCase): | ||
| 121 | 'msodde/harmless-clean.docx': (False,), | 121 | 'msodde/harmless-clean.docx': (False,), |
| 122 | 'oleform/oleform-PR314.docm': (False,), | 122 | 'oleform/oleform-PR314.docm': (False,), |
| 123 | 'basic/encrypted.docx': CRYPT, | 123 | 'basic/encrypted.docx': CRYPT, |
| 124 | + 'oleobj/external_link/sample_with_external_link_to_doc.docx': (False,), | ||
| 125 | + 'oleobj/external_link/sample_with_external_link_to_doc.xlsb': (False,), | ||
| 126 | + 'oleobj/external_link/sample_with_external_link_to_doc.dotm': (False,), | ||
| 127 | + 'oleobj/external_link/sample_with_external_link_to_doc.xlsm': (False,), | ||
| 128 | + 'oleobj/external_link/sample_with_external_link_to_doc.pptx': (False,), | ||
| 129 | + 'oleobj/external_link/sample_with_external_link_to_doc.dotx': (False,), | ||
| 130 | + 'oleobj/external_link/sample_with_external_link_to_doc.docm': (False,), | ||
| 131 | + 'oleobj/external_link/sample_with_external_link_to_doc.potm': (False,), | ||
| 132 | + 'oleobj/external_link/sample_with_external_link_to_doc.xlsx': (False,), | ||
| 133 | + 'oleobj/external_link/sample_with_external_link_to_doc.potx': (False,), | ||
| 134 | + 'oleobj/external_link/sample_with_external_link_to_doc.ppsm': (False,), | ||
| 135 | + 'oleobj/external_link/sample_with_external_link_to_doc.pptm': (False,), | ||
| 136 | + 'oleobj/external_link/sample_with_external_link_to_doc.ppsx': (False,), | ||
| 137 | + 'encrypted/autostart-encrypt-standardpassword.xlsm': | ||
| 138 | + (True, False, 'unknown', True, False, False, False, False, False, False, 0), | ||
| 139 | + 'encrypted/autostart-encrypt-standardpassword.xls': | ||
| 140 | + (True, True, EXCEL, True, False, True, True, False, False, False, 0), | ||
| 141 | + 'encrypted/dde-test-encrypt-standardpassword.xlsx': | ||
| 142 | + (True, False, 'unknown', True, False, False, False, False, False, False, 0), | ||
| 143 | + 'encrypted/dde-test-encrypt-standardpassword.xlsm': | ||
| 144 | + (True, False, 'unknown', True, False, False, False, False, False, False, 0), | ||
| 145 | + 'encrypted/autostart-encrypt-standardpassword.xlsb': | ||
| 146 | + (True, False, 'unknown', True, False, False, False, False, False, False, 0), | ||
| 147 | + 'encrypted/dde-test-encrypt-standardpassword.xls': | ||
| 148 | + (True, True, EXCEL, True, False, False, True, False, False, False, 0), | ||
| 149 | + 'encrypted/dde-test-encrypt-standardpassword.xlsb': | ||
| 150 | + (True, False, 'unknown', True, False, False, False, False, False, False, 0), | ||
| 124 | } | 151 | } |
| 125 | 152 | ||
| 126 | indicator_names = [] | 153 | indicator_names = [] |
| @@ -148,7 +175,8 @@ class TestOleIDBasic(unittest.TestCase): | @@ -148,7 +175,8 @@ class TestOleIDBasic(unittest.TestCase): | ||
| 148 | OLE_VALUES[name])) | 175 | OLE_VALUES[name])) |
| 149 | except KeyError: | 176 | except KeyError: |
| 150 | print('Should add oleid output for {} to {} ({})' | 177 | print('Should add oleid output for {} to {} ({})' |
| 151 | - .format(name, __name__, values[3:])) | 178 | + .format(name, __name__, values)) |
| 179 | + | ||
| 152 | 180 | ||
| 153 | # just in case somebody calls this file as a script | 181 | # just in case somebody calls this file as a script |
| 154 | if __name__ == '__main__': | 182 | if __name__ == '__main__': |