Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unittests #769

Merged
merged 2 commits into from
Nov 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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