def test_color_names_in_backgroundare_accepted(self): doc = LaTeXDocument(r"A = \pi r^2") doc.set_background_color("cyan") doc = str(doc) self.assertTrue("pagecolor{cyan}" in doc, "Expected \\pagecolor in document, got: %s" % doc) self.assertTrue("\\color" not in doc) self.assertFalse("definecolor" in doc)
def test_hex_colours_with_leading_0s_work(self): doc = LaTeXDocument(r'A = \pi r^2') doc.set_background_color('00FFCC') doc = str(doc) self.assertTrue('pagecolor{background}' in doc, "Expected \\pagecolor in document, got: %s" % doc) self.assertTrue('definecolor' in doc) self.assertTrue('00FFCC' in doc)
def test_color_names_in_backgroundare_accepted(self): doc = LaTeXDocument(r'A = \pi r^2') doc.set_background_color('cyan') doc = str(doc) self.assertTrue('pagecolor{cyan}' in doc, "Expected \\pagecolor in document, got: %s" % doc) self.assertTrue('\\color' not in doc) self.assertFalse('definecolor' in doc)
def test_color_rgb_in_backgroundare_accepted(self): doc = LaTeXDocument(r'A = \pi r^2') doc.set_background_color('FFAACC') doc = str(doc) self.assertTrue('pagecolor{background}' in doc, "Expected \\pagecolor in document, got: %s" % doc) self.assertTrue('\\color' not in doc) self.assertTrue('definecolor' in doc) self.assertTrue('FFAACC' in doc)
def test_hex_colours_with_leading_0s_work(self): doc = LaTeXDocument(r"A = \pi r^2") doc.set_background_color("00FFCC") doc = str(doc) self.assertTrue( "pagecolor{background}" in doc, "Expected \\pagecolor in document, got: %s" % doc, ) self.assertTrue("definecolor" in doc) self.assertTrue("00FFCC" in doc)
def test_color_rgb_in_backgroundare_accepted(self): doc = LaTeXDocument(r"A = \pi r^2") doc.set_background_color("FFAACC") doc = str(doc) self.assertTrue( "pagecolor{background}" in doc, "Expected \\pagecolor in document, got: %s" % doc, ) self.assertTrue("\\color" not in doc) self.assertTrue("definecolor" in doc) self.assertTrue("FFAACC" in doc)