Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
def print_xml(results, options):
    print(xml_output(list(results), options.verbose))
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
def print_xml(results, options):
    print(xml_output(list(results), options.verbose))