def test_ref(self): style = ReSTStyle(ReSTDocument()) style.ref('foobar', 'http://foo.bar.com') self.assertEqual(style.doc.getvalue(), six.b(':doc:`foobar <http://foo.bar.com>`'))