示例#1
0
 def _each_parens(self, with_parens, math, parens, tall=False):
     """
     Helper method to test the way parens are wrapped.
     """
     obj = preview.LatexRendered(math, parens=parens, tall=tall)
     self.assertEquals(obj.latex, with_parens)
     self.assertEquals(obj.sans_parens, math)
     self.assertEquals(obj.tall, tall)
示例#2
0
 def test_simple(self):
     """
     Test that the data values are stored without changing.
     """
     math = 'x^2'
     obj = preview.LatexRendered(math, tall=True)
     self.assertEquals(obj.latex, math)
     self.assertEquals(obj.sans_parens, math)
     self.assertEquals(obj.tall, True)
示例#3
0
 def test_bad_parens(self):
     """ Check that we get an error with invalid parens. """
     with self.assertRaisesRegexp(Exception, 'Unknown parenthesis'):
         preview.LatexRendered('x^2', parens='not parens')