Commit 661cd5eb8c6f4fd5476b024be3ee03a6e8471dfd
Committed by
Philippe Lagadec
1 parent
9f71892c
Initial support for unit tests (#201)
Showing
8 changed files
with
32 additions
and
0 deletions
.travis.yml
0 → 100644
README.md
| 1 | python-oletools | 1 | python-oletools |
| 2 | =============== | 2 | =============== |
| 3 | [](https://pypi.python.org/pypi/oletools) | 3 | [](https://pypi.python.org/pypi/oletools) |
| 4 | + | ||
| 4 | 5 | ||
| 5 | [oletools](http://www.decalage.info/python/oletools) is a package of python tools to analyze | 6 | [oletools](http://www.decalage.info/python/oletools) is a package of python tools to analyze |
| 6 | [Microsoft OLE2 files](http://en.wikipedia.org/wiki/Compound_File_Binary_Format) | 7 | [Microsoft OLE2 files](http://en.wikipedia.org/wiki/Compound_File_Binary_Format) |
setup.py
| @@ -314,6 +314,7 @@ def main(): | @@ -314,6 +314,7 @@ def main(): | ||
| 314 | download_url=download_url, | 314 | download_url=download_url, |
| 315 | # data_files=data_files, | 315 | # data_files=data_files, |
| 316 | entry_points=entry_points, | 316 | entry_points=entry_points, |
| 317 | + test_suite="tests", | ||
| 317 | # scripts=scripts, | 318 | # scripts=scripts, |
| 318 | ) | 319 | ) |
| 319 | 320 |
tests/__init__.py
0 → 100644
tests/rtfobj/__init__.py
0 → 100644
tests/rtfobj/test_issue_185.py
0 → 100644
| 1 | +import unittest, sys, os | ||
| 2 | + | ||
| 3 | +from .. import testdata_reader | ||
| 4 | +from oletools import rtfobj | ||
| 5 | + | ||
| 6 | +class TestRtfObjIssue185(unittest.TestCase): | ||
| 7 | + def test_skip_space_after_bin_control_word(self): | ||
| 8 | + data = testdata_reader.read('rtfobj/issue_185.rtf') | ||
| 9 | + rtfp = rtfobj.RtfObjParser(data) | ||
| 10 | + rtfp.parse() | ||
| 11 | + objects = rtfp.objects | ||
| 12 | + | ||
| 13 | + self.assertTrue(len(objects) == 1) | ||
| 14 | + | ||
| 15 | +if __name__ == '__main__': | ||
| 16 | + unittest.main() |
tests/test-data/rtfobj/issue_185.rtf
0 → 100644