Exemplo n.º 1
0
 def test_titles_content_is_kept_with_ending_point(self):
     title = "==Cool Stuff==\nHere it is."
     self.doc.metadata['raw_text'] = title
     media_wiki_to_txt(self.doc)
     self.assertEqual(self.doc.text, 'Cool Stuff.\nHere it is.')
Exemplo n.º 2
0
 def test_new_lines_are_preserved(self):
     text = 'Hello\nmy\nloved\nworld.'
     self.doc.metadata['raw_text'] = text
     media_wiki_to_txt(self.doc)
     self.assertEqual(self.doc.text, text)
Exemplo n.º 3
0
 def test_directives_are_stripped_enterely(self):
     direct = "{{episodes\n|previous = Private Lives\n|next = Lockdown\n}}"
     self.doc.metadata['raw_text'] += direct
     media_wiki_to_txt(self.doc)
     self.assertEqual(self.doc.text, 'hello world')
Exemplo n.º 4
0
 def test_with_empty_document_not_save_is_done(self):
     self.doc.metadata = {}
     media_wiki_to_txt(self.doc)
     self.assertFalse(self.mock_save.called)
Exemplo n.º 5
0
 def test_save_is_called(self):
     media_wiki_to_txt(self.doc)
     self.mock_save.assert_called_once_with()
Exemplo n.º 6
0
 def test_simple_text_is_preserved(self):
     media_wiki_to_txt(self.doc)
     self.assertEqual(self.doc.text, 'hello world')