Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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')