def test_code(self): style = ReSTStyle(ReSTDocument()) style.code('foobar') self.assertEqual(style.doc.getvalue(), six.b('``foobar`` '))