class TestXMLOutput(unittest.TestCase): foo = FunctionInfo("foo", '', 100) foo.cyclomatic_complexity = 16 file_infos = [FileInformation('f1.c', 1, [foo])] xml = xml_output(file_infos, True) def test_xml_output(self): self.assertIn('''foo at f1.c:100''', self.xml) def test_xml_stylesheet(self): self.assertIn('''<?xml-stylesheet type="text/xsl" href="https://raw.github.com/terryyin/lizard/master/lizard.xsl"?>''', self.xml)
class TestXMLOutput(unittest.TestCase): foo = FunctionInfo("foo", '', 100) foo.cyclomatic_complexity = 16 file_infos = [FileInformation('f1.c', 1, [foo])] xml = xml_output(file_infos, True) def test_xml_output(self): self.assertIn('''foo at f1.c:100''', self.xml) def test_xml_stylesheet(self): self.assertIn('''<?xml-stylesheet type="text/xsl" href="https://raw.githubusercontent.com/terryyin/lizard/master/lizard.xsl"?>''', self.xml) def test_xml_output_on_empty_folder(self): xml_empty = xml_output([], True) self.assertIn('''<sum label="NCSS" value="0"/>''', xml_empty) self.assertIn('''<sum label="CCN" value="0"/>''', xml_empty) self.assertIn('''<sum label="Functions" value="0"/>''', xml_empty)
def print_xml(results, options): print(xml_output(list(results), options.verbose))
def test_xml_output_on_empty_folder(self): xml_empty = xml_output(AllResult([]), True) self.assertIn('''<sum label="NCSS" value="0"/>''', xml_empty) self.assertIn('''<sum label="CCN" value="0"/>''', xml_empty) self.assertIn('''<sum label="Functions" value="0"/>''', xml_empty)