Skip to content

Commit

Permalink
Merge pull request #769 from christian-intra2net/fix-unittests
Browse files Browse the repository at this point in the history
Fix unittests
  • Loading branch information
decalage2 authored Nov 27, 2022
2 parents e150f89 + 560b903 commit 4cbf6aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion oletools/olevba.py
Original file line number Diff line number Diff line change
Expand Up @@ -3112,7 +3112,7 @@ def open_slk(self, data):
xlm_macro_found = False
xlm_macros = []
xlm_macros.append('Formulas and XLM/Excel 4 macros extracted from SLK file:')
for line in data.splitlines(keepends=False):
for line in data.splitlines(False):
if line.startswith(b'O'):
# Option: "O;E" indicates a macro sheet, must appear before NN and C rows
for s in line.split(b';'):
Expand Down
5 changes: 1 addition & 4 deletions tests/olevba/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,9 @@ def test_xlm(self):
args=[full_name, ] + ADD_ARGS,
accept_nonzero_exit=True)
output = json.loads(out_str)
self.assertEqual(len(output), 3)
self.assertEqual(len(output), 2)
self.assertEqual(output[0]['type'], 'MetaInformation')
self.assertEqual(output[0]['script_name'], 'olevba')
self.assertEqual(output[-1]['type'], 'MetaInformation')
self.assertEqual(output[-1]['n_processed'], 1)
self.assertEqual(output[-1]['return_code'], 0)
result = output[1]
self.assertTrue(result['json_conversion_successful'])
if suffix in ('.xlsb', '.xltm', '.xlsm'):
Expand Down

0 comments on commit 4cbf6aa

Please sign in to comment.