Commit abf93bda96c8885fe0333f261f9fa3c342e53bd7

Authored by Christian Herdtweck
Committed by Philippe Lagadec
1 parent 0eb0d794

unittest: add excel 2007+ test files to msodde-test

tests/msodde/test_basic.py
... ... @@ -76,7 +76,7 @@ class TestReturnCode(unittest.TestCase):
76 76 return_code))
77 77  
78 78  
79   -class TestDdeInDoc(unittest.TestCase):
  79 +class TestDdeLinks(unittest.TestCase):
80 80  
81 81 def get_dde_from_output(self, capturer):
82 82 """ helper to read dde links from captured output """
... ... @@ -116,6 +116,15 @@ class TestDdeInDoc(unittest.TestCase):
116 116 self.assertNotEqual(len(self.get_dde_from_output(capturer)), 0,
117 117 msg='Found no dde links in output for doc file')
118 118  
  119 + def test_excel(self):
  120 + """ check that dde links are found in excel 2007+ files """
  121 + expect = ['DDE-Link cmd /c calc.exe', ]
  122 + for extn in 'xlsx', 'xlsm': # not yet: 'xlsb'
  123 + with OutputCapture() as capturer:
  124 + msodde.main([join(BASE_DIR, 'msodde', 'dde-test.' + extn), ])
  125 + self.assertEqual(expect, self.get_dde_from_output(capturer))
  126 +
  127 +
119 128  
120 129 if __name__ == '__main__':
121 130 unittest.main()
... ...
tests/test-data/msodde/dde-test.xlsm 0 → 100644
No preview for this file type
tests/test-data/msodde/dde-test.xlsx 0 → 100644
No preview for this file type