Commit f0b17938bc2ad6686e3edbb04838c6e8bba67d26
1 parent
22b3af57
tests: test is_word, is_excel, is_powerpoint
Showing
1 changed file
with
11 additions
and
0 deletions
tests/ftguess/test_basic.py
| @@ -91,6 +91,17 @@ class TestFTGuess(unittest.TestCase): | @@ -91,6 +91,17 @@ class TestFTGuess(unittest.TestCase): | ||
| 91 | .format(guess.application, filename, | 91 | .format(guess.application, filename, |
| 92 | expect.application)) | 92 | expect.application)) |
| 93 | 93 | ||
| 94 | + if expect not in (ftguess.FType_Generic_OLE, ftguess.FType_Unknown): | ||
| 95 | + self.assertEqual(guess.is_excel(), extension.startswith('x') | ||
| 96 | + and extension != 'xml' | ||
| 97 | + and extension != 'xlsb' | ||
| 98 | + and extension != 'xps') | ||
| 99 | + # xlsb is excel but not handled properly yet | ||
| 100 | + self.assertEqual(guess.is_word(), extension.startswith('d')) | ||
| 101 | + self.assertEqual(guess.is_powerpoint(), | ||
| 102 | + extension.startswith('p')) | ||
| 103 | + | ||
| 104 | + | ||
| 94 | 105 | ||
| 95 | # just in case somebody calls this file as a script | 106 | # just in case somebody calls this file as a script |
| 96 | if __name__ == '__main__': | 107 | if __name__ == '__main__': |