import unittest import utils.css_tool import basic.program import json class MyTestCase(unittest.TestCase): def runTest(self): self.test_css() def test_css(self): job = basic.program.Job("unit") args = {"application": "TEST", "application": "ENV01", "modus": "unit", "loglevel": "debug", "tool": "job_tool", "tdtyp": "csv", "tdsrc": "implement", "tdname": "firstunit", "modus": "unit"} job.par.setParameterArgs(args) print("eeeeeeeee") print(json.dumps(job.conf.confs)) # ------- inline --------------- job.conf.setConfig("tools.csstyp", "inline") job.conf.confs.get("tools")["csstyp"] == "inline" text = utils.css_tool.getInlineStyle("diffFiles", "diffA") self.assertEqual(len(text), 37) self.assertEqual(("style" in text), True) text = utils.css_tool.getInlineStyle("diffFiles", "acceptA") self.assertEqual(len(text), 23) self.assertEqual(("style" in text), True) text = utils.css_tool.getInlineStyle("resultFile", "result1") self.assertEqual(len(text), 36) self.assertEqual(("style" in text), True) text = utils.css_tool.getInternalStyle("diffFiles") self.assertEqual(len(text), 84) text = utils.css_tool.getExternalStyle("diffFiles") self.assertEqual(len(text), 0) # ------- internal --------------- job.conf.setConfig("tools.csstyp", "internal") text = utils.css_tool.getInlineStyle("diffFiles", "diffA") self.assertEqual(len(text), 13) self.assertEqual(("class" in text), True) text = utils.css_tool.getInlineStyle("resultFile", "result1") self.assertEqual(len(text), 15) self.assertEqual(("class" in text), True) text = utils.css_tool.getInternalStyle("diffFiles") print(text) self.assertEqual(len(text), 237) self.assertEqual(("