Data-Test-Executer Framework speziell zum Test von Datenverarbeitungen mit Datengenerierung, Systemvorbereitungen, Einspielungen, ganzheitlicher diversifizierender Vergleich
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
2.2 KiB

import unittest
import utils.css_tool
import basic.program
import json
class MyTestCase(unittest.TestCase):
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.getInternalStyle("diffFiles")
self.assertEqual(len(text), 0)
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.getInternalStyle("diffFiles")
print(text)
self.assertEqual(len(text), 173)
self.assertEqual(("<style>" in text), True)
text = utils.css_tool.getExternalStyle("diffFiles")
self.assertEqual(len(text), 0)
print(text)
print(str(len(text)))
# ------- external ---------------
job.conf.setConfig("tools.csstyp", "external")
text = utils.css_tool.getInlineStyle("diffFiles", "diffA")
self.assertEqual(len(text), 13)
self.assertEqual(("class" in text), True)
text = utils.css_tool.getInternalStyle("diffFiles")
print(text)
self.assertEqual(len(text), 55)
self.assertEqual(("<link " in text and "stylesheet" in text), True)
text = utils.css_tool.getExternalStyle("diffFiles")
self.assertEqual(len(text), 189)
print(text)
print(str(len(text)))
if __name__ == '__main__':
unittest.main()