From f0b17938bc2ad6686e3edbb04838c6e8bba67d26 Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Mon, 4 Oct 2021 13:46:49 +0200 Subject: [PATCH] tests: test is_word, is_excel, is_powerpoint --- tests/ftguess/test_basic.py | 11 +++++++++++ 1 file changed, 11 insertions(+), 0 deletions(-) diff --git a/tests/ftguess/test_basic.py b/tests/ftguess/test_basic.py index 6308c9b..2fea933 100644 --- a/tests/ftguess/test_basic.py +++ b/tests/ftguess/test_basic.py @@ -91,6 +91,17 @@ class TestFTGuess(unittest.TestCase): .format(guess.application, filename, expect.application)) + if expect not in (ftguess.FType_Generic_OLE, ftguess.FType_Unknown): + self.assertEqual(guess.is_excel(), extension.startswith('x') + and extension != 'xml' + and extension != 'xlsb' + and extension != 'xps') + # xlsb is excel but not handled properly yet + self.assertEqual(guess.is_word(), extension.startswith('d')) + self.assertEqual(guess.is_powerpoint(), + extension.startswith('p')) + + # just in case somebody calls this file as a script if __name__ == '__main__': -- libgit2 0.21.4