コード例 #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.')
コード例 #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)
コード例 #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')
コード例 #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)
コード例 #5
0
 def test_save_is_called(self):
     media_wiki_to_txt(self.doc)
     self.mock_save.assert_called_once_with()
コード例 #6
0
 def test_simple_text_is_preserved(self):
     media_wiki_to_txt(self.doc)
     self.assertEqual(self.doc.text, 'hello world')