Changeset 50416 for OOo/ooo2dbk/trunk/tests/test_ooo2dbk
- Timestamp:
- 12/04/06 12:45:28 (2 years ago)
- Files:
-
- OOo/ooo2dbk/trunk/tests/test_ooo2dbk (moved) (moved from OOo/ooo2dbk/trunk/test_ooo2dbk.py) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
OOo/ooo2dbk/trunk/tests/test_ooo2dbk
r50377 r50416 27 27 import tempfile 28 28 29 test_cases= [{'input_file': ' tests/input/test.sxw',30 'expected_dir': ' tests/output/sxw.out'},29 test_cases= [{'input_file': 'input/test.sxw', 30 'expected_dir': 'output/sxw.out'}, 31 31 32 {'input_file': ' tests/input/test.odt',33 'expected_dir': 'tests/output/odt.out'},32 {'input_file': 'input/test.odt', 33 'expected_dir': 'output/odt.out'}, 34 34 ] 35 35 36 36 def ooo2dbk_tester(input_file, expected_dir): 37 37 38 target_dir = tempfile.mkdtemp(prefix ='ooo2dbk-test-')38 target_dir = tempfile.mkdtemp(prefix='ooo2dbk-test-') 39 39 40 command = '. /ooo2dbk -d %s %s' % (os.path.join(target_dir,'test.docb.xml'),41 input_file)40 command = '../ooo2dbk -d %s %s' % (os.path.join(target_dir,'test.docb.xml'), 41 input_file) 42 42 print command 43 43 os.system(command) … … 50 50 image_to_find = os.path.join(expected_images_dir, image) 51 51 if os.path.isfile(image_to_find): #to avoid .svn dir 52 expect = os.path.join(target_dir, 'images', image)52 expect = os.path.join(target_dir, 'images', image) 53 53 if not os.path.isfile(expect): 54 54 status = status and False … … 66 66 status = False 67 67 print "docbook files are different !" 68 command = "diff %s %s" % (os.path.join(expected_dir, 'test.docb.xml'), 69 os.path.join(target_dir, 'test.docb.xml')) 68 command = ("diff -u %s %s" % 69 (os.path.join(expected_dir, 'test.docb.xml'), 70 os.path.join(target_dir, 'test.docb.xml') 71 ) 72 ) 70 73 os.system(command) 71 74
