コード例 #1
0
 def test_convert_docx(self):
     converter = TikaConverter()
     filename = 'lorem.docx'
     with open(os.path.join(ASSETS, filename)) as file_:
         result = converter.convert_server(file_)
     self.assertEquals(
         'Lorem Ipsum',
         strip_word_bookmarks(result.strip(), filename=filename))
コード例 #2
0
 def test_convert_docx(self):
     converter = TikaConverter()
     filename = 'lorem.docx'
     with open(os.path.join(ASSETS, filename)) as file_:
         result = converter.convert_server(file_)
     self.assertEquals(
         'Lorem Ipsum',
         strip_word_bookmarks(result.strip(), filename=filename))
コード例 #3
0
ファイル: test_utils.py プロジェクト: 25th-floor/ftw.tika
 def test_strip_word_bookmarks_doesnt_touch_files_other_than_docx(self):
     text = '[bookmark: Foo][bookmark: _GoBack]Lorem Ipsum[bookmark: Foo]'
     self.assertEquals(text, strip_word_bookmarks(text))
コード例 #4
0
ファイル: test_utils.py プロジェクト: 25th-floor/ftw.tika
 def test_strip_word_bookmarks_removes_bookmarks_from_docx(self):
     text = '[bookmark: Foo][bookmark: _GoBack]Lorem Ipsum[bookmark: Foo]'
     self.assertEquals(
         'Lorem Ipsum',
         strip_word_bookmarks(text, filename='foo.docx'))
コード例 #5
0
 def test_strip_word_bookmarks_doesnt_touch_files_other_than_docx(self):
     text = '[bookmark: Foo][bookmark: _GoBack]Lorem Ipsum[bookmark: Foo]'
     self.assertEquals(text, strip_word_bookmarks(text))
コード例 #6
0
 def test_strip_word_bookmarks_removes_bookmarks_from_docx(self):
     text = '[bookmark: Foo][bookmark: _GoBack]Lorem Ipsum[bookmark: Foo]'
     self.assertEquals('Lorem Ipsum',
                       strip_word_bookmarks(text, filename='foo.docx'))