Commit 0c3e86bfede1706ba301a3298eff4c2d757b988d
Committed by
Philippe Lagadec
1 parent
e71e7d54
msodde: add detecting an utf-16le dde string.
Showing
3 changed files
with
11 additions
and
1 deletions
oletools/msodde.py
tests/msodde_doc/test_basic.py
| ... | ... | @@ -21,7 +21,7 @@ class TestReturnCode(unittest.TestCase): |
| 21 | 21 | def test_valid_doc(self): |
| 22 | 22 | """ check that a valid doc file leads to 0 exit status """ |
| 23 | 23 | for filename in ('dde-test-from-office2003', 'dde-test-from-office2016', |
| 24 | - 'harmless-clean'): | |
| 24 | + 'harmless-clean', 'dde-test-from-office2013-utf_16le-korean'): | |
| 25 | 25 | self.do_test_validity(join(BASE_DIR, 'msodde-doc', |
| 26 | 26 | filename + '.doc')) |
| 27 | 27 | |
| ... | ... | @@ -108,6 +108,14 @@ class TestDdeInDoc(unittest.TestCase): |
| 108 | 108 | self.assertEqual(len(self.get_dde_from_output(capturer)), 0, |
| 109 | 109 | msg='Found dde links in output for doc file') |
| 110 | 110 | |
| 111 | + def test_with_dde_utf16le(self): | |
| 112 | + """ check that dde links appear on stdout """ | |
| 113 | + with OutputCapture() as capturer: | |
| 114 | + msodde.main([join(BASE_DIR, 'msodde-doc', | |
| 115 | + 'dde-test-from-office2013-utf_16le-korean.doc')]) | |
| 116 | + self.assertNotEqual(len(self.get_dde_from_output(capturer)), 0, | |
| 117 | + msg='Found no dde links in output for doc file') | |
| 118 | + | |
| 111 | 119 | |
| 112 | 120 | if __name__ == '__main__': |
| 113 | 121 | unittest.main() | ... | ... |
tests/test-data/msodde-doc/dde-test-from-office2013-utf_16le-korean.doc
0 → 100644
No preview for this file type