Commit 0eb0d7947faada0a83ed54a5d35d0a680c9b2b5a

Authored by Christian Herdtweck
Committed by Philippe Lagadec
1 parent 5a6b2e00

unittest: remove file type from test module names and data dirs

Will add excel test code and samples later, no need to have separate
folders for different file types.
tests/msodde_doc/__init__.py renamed to tests/msodde/__init__.py
tests/msodde_doc/test_basic.py renamed to tests/msodde/test_basic.py
@@ -22,25 +22,25 @@ class TestReturnCode(unittest.TestCase): @@ -22,25 +22,25 @@ class TestReturnCode(unittest.TestCase):
22 """ check that a valid doc file leads to 0 exit status """ 22 """ check that a valid doc file leads to 0 exit status """
23 for filename in ('dde-test-from-office2003', 'dde-test-from-office2016', 23 for filename in ('dde-test-from-office2003', 'dde-test-from-office2016',
24 'harmless-clean', 'dde-test-from-office2013-utf_16le-korean'): 24 'harmless-clean', 'dde-test-from-office2013-utf_16le-korean'):
25 - self.do_test_validity(join(BASE_DIR, 'msodde-doc', 25 + self.do_test_validity(join(BASE_DIR, 'msodde',
26 filename + '.doc')) 26 filename + '.doc'))
27 27
28 def test_valid_docx(self): 28 def test_valid_docx(self):
29 """ check that a valid docx file leads to 0 exit status """ 29 """ check that a valid docx file leads to 0 exit status """
30 for filename in 'dde-test', 'harmless-clean': 30 for filename in 'dde-test', 'harmless-clean':
31 - self.do_test_validity(join(BASE_DIR, 'msodde-doc', 31 + self.do_test_validity(join(BASE_DIR, 'msodde',
32 filename + '.docx')) 32 filename + '.docx'))
33 33
34 def test_valid_docm(self): 34 def test_valid_docm(self):
35 """ check that a valid docm file leads to 0 exit status """ 35 """ check that a valid docm file leads to 0 exit status """
36 for filename in 'dde-test', 'harmless-clean': 36 for filename in 'dde-test', 'harmless-clean':
37 - self.do_test_validity(join(BASE_DIR, 'msodde-doc', 37 + self.do_test_validity(join(BASE_DIR, 'msodde',
38 filename + '.docm')) 38 filename + '.docm'))
39 39
40 def test_invalid_other(self): 40 def test_invalid_other(self):
41 """ check that xml do not work yet """ 41 """ check that xml do not work yet """
42 for extn in '-2003.xml', '.xml': 42 for extn in '-2003.xml', '.xml':
43 - self.do_test_validity(join(BASE_DIR, 'msodde-doc', 43 + self.do_test_validity(join(BASE_DIR, 'msodde',
44 'harmless-clean' + extn), True) 44 'harmless-clean' + extn), True)
45 45
46 def test_invalid_none(self): 46 def test_invalid_none(self):
@@ -96,7 +96,7 @@ class TestDdeInDoc(unittest.TestCase): @@ -96,7 +96,7 @@ class TestDdeInDoc(unittest.TestCase):
96 def test_with_dde(self): 96 def test_with_dde(self):
97 """ check that dde links appear on stdout """ 97 """ check that dde links appear on stdout """
98 with OutputCapture() as capturer: 98 with OutputCapture() as capturer:
99 - msodde.main([join(BASE_DIR, 'msodde-doc', 99 + msodde.main([join(BASE_DIR, 'msodde',
100 'dde-test-from-office2003.doc')]) 100 'dde-test-from-office2003.doc')])
101 self.assertNotEqual(len(self.get_dde_from_output(capturer)), 0, 101 self.assertNotEqual(len(self.get_dde_from_output(capturer)), 0,
102 msg='Found no dde links in output for doc file') 102 msg='Found no dde links in output for doc file')
@@ -104,14 +104,14 @@ class TestDdeInDoc(unittest.TestCase): @@ -104,14 +104,14 @@ class TestDdeInDoc(unittest.TestCase):
104 def test_no_dde(self): 104 def test_no_dde(self):
105 """ check that no dde links appear on stdout """ 105 """ check that no dde links appear on stdout """
106 with OutputCapture() as capturer: 106 with OutputCapture() as capturer:
107 - msodde.main([join(BASE_DIR, 'msodde-doc', 'harmless-clean.doc')]) 107 + msodde.main([join(BASE_DIR, 'msodde', 'harmless-clean.doc')])
108 self.assertEqual(len(self.get_dde_from_output(capturer)), 0, 108 self.assertEqual(len(self.get_dde_from_output(capturer)), 0,
109 msg='Found dde links in output for doc file') 109 msg='Found dde links in output for doc file')
110 110
111 def test_with_dde_utf16le(self): 111 def test_with_dde_utf16le(self):
112 """ check that dde links appear on stdout """ 112 """ check that dde links appear on stdout """
113 with OutputCapture() as capturer: 113 with OutputCapture() as capturer:
114 - msodde.main([join(BASE_DIR, 'msodde-doc', 114 + msodde.main([join(BASE_DIR, 'msodde',
115 'dde-test-from-office2013-utf_16le-korean.doc')]) 115 'dde-test-from-office2013-utf_16le-korean.doc')])
116 self.assertNotEqual(len(self.get_dde_from_output(capturer)), 0, 116 self.assertNotEqual(len(self.get_dde_from_output(capturer)), 0,
117 msg='Found no dde links in output for doc file') 117 msg='Found no dde links in output for doc file')
tests/msodde_docx/test_blacklist.py renamed to tests/msodde/test_blacklist.py
tests/msodde_docx/__init__.py deleted
tests/test-data/msodde-doc/dde-test-from-office2003.doc renamed to tests/test-data/msodde/dde-test-from-office2003.doc
No preview for this file type
tests/test-data/msodde-doc/dde-test-from-office2013-utf_16le-korean.doc renamed to tests/test-data/msodde/dde-test-from-office2013-utf_16le-korean.doc
No preview for this file type
tests/test-data/msodde-doc/dde-test-from-office2016.doc renamed to tests/test-data/msodde/dde-test-from-office2016.doc
No preview for this file type
tests/test-data/msodde-doc/dde-test.docm renamed to tests/test-data/msodde/dde-test.docm
No preview for this file type
tests/test-data/msodde-doc/dde-test.docx renamed to tests/test-data/msodde/dde-test.docx
No preview for this file type
tests/test-data/msodde-doc/harmless-clean-2003.xml renamed to tests/test-data/msodde/harmless-clean-2003.xml
tests/test-data/msodde-doc/harmless-clean.doc renamed to tests/test-data/msodde/harmless-clean.doc
No preview for this file type
tests/test-data/msodde-doc/harmless-clean.docm renamed to tests/test-data/msodde/harmless-clean.docm
No preview for this file type
tests/test-data/msodde-doc/harmless-clean.docx renamed to tests/test-data/msodde/harmless-clean.docx
No preview for this file type
tests/test-data/msodde-doc/harmless-clean.xml renamed to tests/test-data/msodde/harmless-clean.xml