From a58b74397e1c0a551a35c041eb1dc8a6bc8d846c Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Thu, 7 Dec 2017 17:27:25 +0100 Subject: [PATCH] unittests: create 2 tests for msodde with rtf with/out -d option --- tests/msodde/test_basic.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/msodde/test_basic.py b/tests/msodde/test_basic.py index e610c77..7033741 100644 --- a/tests/msodde/test_basic.py +++ b/tests/msodde/test_basic.py @@ -127,11 +127,18 @@ class TestDdeLinks(unittest.TestCase): msg='unexpected output for dde-test.{0}: {1}' .format(extn, capturer.get_data())) - def test_clean_rtf(self): - """ check that clean RTF file causes no trouble """ + def test_clean_rtf_blacklist(self): + """ find a lot of hyperlinks in rtf spec """ filename = 'RTF-Spec-1.7.rtf' with OutputCapture() as capturer: msodde.main([join(BASE_DIR, 'msodde', filename)]) + self.assertEqual(len(self.get_dde_from_output(capturer)), 1413) + + def test_clean_rtf_ddeonly(self): + """ find no dde links in rtf spec """ + filename = 'RTF-Spec-1.7.rtf' + with OutputCapture() as capturer: + msodde.main(['-d', join(BASE_DIR, 'msodde', filename)]) self.assertEqual(len(self.get_dde_from_output(capturer)), 0, msg='Found dde links in output of ' + filename) -- libgit2 0.21.4