Skip to content

Commit 266b0e0

Browse files
Add sample name to unittest fail message.
Should help debugging unexpected results.
1 parent 6b18caa commit 266b0e0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/oleid/test_basic.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def test_properties(self):
6868
self.assertEqual(value_dict['author'],
6969
b'\xb1\xe8\xb1\xe2\xc1\xa4;kijeong')
7070
elif 'olevba/sample_with_vba.ppt' in filename:
71-
print("\nTODO: find reason for different results for olevba/sample_with_vba.ppt")
71+
print('\nTODO: find reason for different results for olevba/sample_with_vba.ppt')
7272
# on korean test machine, this is the result:
7373
# self.assertEqual(value_dict['codepage'],
7474
# '949: ANSI/OEM Korean (Unified Hangul Code)')
@@ -77,10 +77,14 @@ def test_properties(self):
7777
continue
7878
else:
7979
self.assertEqual(value_dict['codepage'],
80-
'1252: ANSI Latin 1; Western European (Windows)')
80+
'1252: ANSI Latin 1; Western European (Windows)',
81+
'Unexpected result {0!r} for codepage of sample {1}'
82+
.format(value_dict['codepage'], filename))
8183
self.assertIn(value_dict['author'],
8284
(b'user', b'schulung',
83-
b'xxxxxxxxxxxx', b'zzzzzzzzzzzz'))
85+
b'xxxxxxxxxxxx', b'zzzzzzzzzzzz'),
86+
'Unexpected result {0!r} for author of sample {1}'
87+
.format(value_dict['author'], filename))
8488

8589
def test_encrypted(self):
8690
"""Test indicator "encrypted"."""

0 commit comments

Comments
 (0)