Skip to content

Commit

Permalink
Add sample name to unittest fail message.
Browse files Browse the repository at this point in the history
Should help debugging unexpected results.
  • Loading branch information
christian-intra2net committed May 31, 2024
1 parent 6b18caa commit 266b0e0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/oleid/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_properties(self):
self.assertEqual(value_dict['author'],
b'\xb1\xe8\xb1\xe2\xc1\xa4;kijeong')
elif 'olevba/sample_with_vba.ppt' in filename:
print("\nTODO: find reason for different results for olevba/sample_with_vba.ppt")
print('\nTODO: find reason for different results for olevba/sample_with_vba.ppt')
# on korean test machine, this is the result:
# self.assertEqual(value_dict['codepage'],
# '949: ANSI/OEM Korean (Unified Hangul Code)')
Expand All @@ -77,10 +77,14 @@ def test_properties(self):
continue
else:
self.assertEqual(value_dict['codepage'],
'1252: ANSI Latin 1; Western European (Windows)')
'1252: ANSI Latin 1; Western European (Windows)',
'Unexpected result {0!r} for codepage of sample {1}'
.format(value_dict['codepage'], filename))
self.assertIn(value_dict['author'],
(b'user', b'schulung',
b'xxxxxxxxxxxx', b'zzzzzzzzzzzz'))
b'xxxxxxxxxxxx', b'zzzzzzzzzzzz'),
'Unexpected result {0!r} for author of sample {1}'
.format(value_dict['author'], filename))

def test_encrypted(self):
"""Test indicator "encrypted"."""
Expand Down

0 comments on commit 266b0e0

Please sign in to comment.