Example #1
0
 def test_can_parse_csv(self):
     content = (
         """6,Suspicious Comment,"Comment Indicates Potentially Unfinished Code","The comment includes some wording which indicates that the developer regards it as unfinished or does not trust it to work correctly.",C:\\Projects\\WebGoat.Net\\Core\\Cart.cs,16,"TODO: Refactor this. Use LINQ with aggregation to get SUM.",False,"LawnGreen"""
         "")
     filename = TestFile("data.csv", content)
     parser = VCGParser()
     findings = parser.get_findings(filename, Test())
     self.assertEqual(1, len(findings))
Example #2
0
 def test_can_parse_xml(self):
     content = """<?xml version="1.0" encoding="utf-8"?>
     <!--XML Export of VCG Results for directory: C:\\Projects\\WebGoat.Net. Scanned for C# security issues.-->
     <CodeIssueCollection>
     <CodeIssue>
     <Priority>6</Priority>
     <Severity>Suspicious Comment</Severity>
     <Title>Comment Indicates Potentially Unfinished Code</Title>
     <Description>The comment includes some wording which indicates that the developer regards
     it as unfinished or does not trust it to work correctly.</Description>
     <FileName>Findings.xml</FileName>
     <Line>21</Line>
     <CodeLine>TODO: Check the Code</CodeLine>
     <Checked>False</Checked>
     <CheckColour>LawnGreen</CheckColour>
     </CodeIssue>
     </CodeIssueCollection>"""
     filename = TestFile("data.xml", content)
     parser = VCGParser()
     findings = parser.get_findings(filename, Test())
     self.assertEqual(1, len(findings))