Skip to content

Commit

Permalink
Add the vba ppt sample to the find_vba list in the test_macros fu…
Browse files Browse the repository at this point in the history
…nction.

The file 'olevba/sample_with_vba.ppt' contains an actual VBA macro.
  • Loading branch information
kijeong committed Jun 25, 2024
1 parent 1395b25 commit 9ea3f13
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions tests/oleid/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,14 @@ def test_properties(self):
self.assertEqual(value_dict['author'],
b'\xb1\xe8\xb1\xe2\xc1\xa4;kijeong')
elif join('olevba', 'sample_with_vba.ppt') in filename:
print('\nTODO: find reason for different results for sample_with_vba.ppt')
# on korean test machine, this is the result:
# self.assertEqual(value_dict['codepage'],
# '949: ANSI/OEM Korean (Unified Hangul Code)')
# self.assertEqual(value_dict['author'],
# b'\xb1\xe8 \xb1\xe2\xc1\xa4')
continue
self.assertEqual(value_dict['codepage'],
'949: ANSI/OEM Korean (Unified Hangul Code)',
'Unexpected result {0!r} for codepage of sample {1}'
.format(value_dict['codepage'], filename))
self.assertEqual(value_dict['author'],
b'\xb1\xe8 \xb1\xe2\xc1\xa4',
'Unexpected result {0!r} for author of sample {1}'
.format(value_dict['author'], filename))
else:
self.assertEqual(value_dict['codepage'],
'1252: ANSI Latin 1; Western European (Windows)',
Expand Down Expand Up @@ -121,8 +122,6 @@ def test_macros(self):
join('oleform', 'oleform-PR314.docm'),
join('basic', 'empty'), # WTF?
join('basic', 'text'),
)
todo_inconsistent_results = (
join('olevba', 'sample_with_vba.ppt'),
)
for filename, value_dict in self.oleids:
Expand All @@ -138,10 +137,6 @@ def test_macros(self):
self.assertIn(value_dict['xlm'], ('Unknown', 'No'))

# "macro detection" in text files leads to interesting results:
if filename in todo_inconsistent_results:
print("\nTODO: need to determine result inconsistency for sample {0}"
.format(filename))
continue
if filename in find_vba: # no macros!
self.assertEqual(value_dict['vba'], 'Yes')
else:
Expand Down

0 comments on commit 9ea3f13

Please # to comment.