From 6ff77414b3fd55fb243f4e27c4df9de0598e9098 Mon Sep 17 00:00:00 2001 From: hugovk Date: Mon, 14 Apr 2014 00:05:31 +0300 Subject: [PATCH] Test some debug functions. No asserts, just check they run ok. --- Tests/run.py | 5 +++++ Tests/test_olefileio.py | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/Tests/run.py b/Tests/run.py index 4dccc005a..758923f0f 100644 --- a/Tests/run.py +++ b/Tests/run.py @@ -58,6 +58,11 @@ for file in files: )) result = out.read() + result_lines = result.splitlines() + if len(result_lines): + if result_lines[0] == "ignore_all_except_last_line": + result = result_lines[-1] + # Extract any ignore patterns ignore_pats = ignore_re.findall(result) result = ignore_re.sub('', result) diff --git a/Tests/test_olefileio.py b/Tests/test_olefileio.py index b4531e641..f31845556 100644 --- a/Tests/test_olefileio.py +++ b/Tests/test_olefileio.py @@ -135,4 +135,26 @@ def test_listdir(): ole.close() +def test_debug(): + # Arrange + print("ignore_all_except_last_line") + ole_file = "Tests/images/test-ole-file.doc" + ole = OleFileIO.OleFileIO(ole_file) + meta = ole.get_metadata() + + # Act + OleFileIO.set_debug_mode(True) + ole.dumpdirectory() + meta.dump() + + OleFileIO.set_debug_mode(False) + ole.dumpdirectory() + meta.dump() + + # Assert + # No assert, just check they run ok + print("ok") + ole.close() + + # End of file