def test_codeblock(self): style = ReSTStyle(ReSTDocument()) style.codeblock('foobar') self.assertEqual(style.doc.getvalue(), six.b('::\n\n foobar\n\n\n'))