예제 #1
0
 def test_generate_report(self):
     shutil.copyfile('./tests/mock_files/dependency-check-report.json',
                     '/tmp/dependency-check-report.json')
     self.assertEqual(
         OwaspDepCheck('')._read_report(),
         json.loads(mock_owasp_dep_check_generated_repo))
     os.remove('/tmp/dependency-check-report.json')
예제 #2
0
def run_tools(path_to_analyze):
    # -- Run all analysis
    retirejs_report = RetireJS(path=path_to_analyze).run_retirejs()
    owasp_depcheck_report = OwaspDepCheck(path=path_to_analyze).run_owasp_depcheck()

    # -- Generate full report and return
    full_report = json.dumps(_avoid_repetition(retirejs_report + owasp_depcheck_report))
    return full_report
예제 #3
0
 def test_get_type_unknown(self):
     self.assertEqual(OwaspDepCheck('')._get_type('dependency.exe', '/home/user/dependency.exe'), 'unknown')
예제 #4
0
 def test_get_type_php(self):
     self.assertEqual(OwaspDepCheck('')._get_type('dependency.php', '/home/user/dependency.php'), 'php')
예제 #5
0
 def test_get_type_ruby(self):
     self.assertEqual(OwaspDepCheck('')._get_type('dependency.rb', '/home/user/dependency.rb'), 'ruby')
예제 #6
0
 def test_get_type_python(self):
     self.assertEqual(OwaspDepCheck('')._get_type('dependency.py', '/home/user/dependency.py'), 'python')
예제 #7
0
 def test_get_type_js(self):
     self.assertEqual(OwaspDepCheck('')._get_type('dependency.js', '/home/user/dependency.js'), 'js')
예제 #8
0
 def test_get_type_java(self):
     self.assertEqual(OwaspDepCheck('')._get_type('dependency.jar'), 'java')