Commit a58b74397e1c0a551a35c041eb1dc8a6bc8d846c
1 parent
2bd665ad
unittests: create 2 tests for msodde with rtf with/out -d option
Showing
1 changed file
with
9 additions
and
2 deletions
tests/msodde/test_basic.py
| @@ -127,11 +127,18 @@ class TestDdeLinks(unittest.TestCase): | @@ -127,11 +127,18 @@ class TestDdeLinks(unittest.TestCase): | ||
| 127 | msg='unexpected output for dde-test.{0}: {1}' | 127 | msg='unexpected output for dde-test.{0}: {1}' |
| 128 | .format(extn, capturer.get_data())) | 128 | .format(extn, capturer.get_data())) |
| 129 | 129 | ||
| 130 | - def test_clean_rtf(self): | ||
| 131 | - """ check that clean RTF file causes no trouble """ | 130 | + def test_clean_rtf_blacklist(self): |
| 131 | + """ find a lot of hyperlinks in rtf spec """ | ||
| 132 | filename = 'RTF-Spec-1.7.rtf' | 132 | filename = 'RTF-Spec-1.7.rtf' |
| 133 | with OutputCapture() as capturer: | 133 | with OutputCapture() as capturer: |
| 134 | msodde.main([join(BASE_DIR, 'msodde', filename)]) | 134 | msodde.main([join(BASE_DIR, 'msodde', filename)]) |
| 135 | + self.assertEqual(len(self.get_dde_from_output(capturer)), 1413) | ||
| 136 | + | ||
| 137 | + def test_clean_rtf_ddeonly(self): | ||
| 138 | + """ find no dde links in rtf spec """ | ||
| 139 | + filename = 'RTF-Spec-1.7.rtf' | ||
| 140 | + with OutputCapture() as capturer: | ||
| 141 | + msodde.main(['-d', join(BASE_DIR, 'msodde', filename)]) | ||
| 135 | self.assertEqual(len(self.get_dde_from_output(capturer)), 0, | 142 | self.assertEqual(len(self.get_dde_from_output(capturer)), 0, |
| 136 | msg='Found dde links in output of ' + filename) | 143 | msg='Found dde links in output of ' + filename) |
| 137 | 144 |