Exemplo n.º 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))
Exemplo n.º 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))
Exemplo n.º 3
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))
Exemplo n.º 4
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'))
Exemplo n.º 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))
Exemplo n.º 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'))