Skip to content

Commit

Permalink
fix clair docs according to PR #9355 (#9523)
Browse files Browse the repository at this point in the history
* fix clair docs according to PR #9355

* remove clair_klar

* update

* start to implement unittest to test if a parser exists for a md file

* unittest to test if parser exists to a documented parser

* add edgescan and codeql to skip this test

* 🎉 works fine, removed asfd
  • Loading branch information
manuel-sommer committed Feb 20, 2024
1 parent 4d7dea4 commit c330575
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/content/en/integrations/parsers/file/clair.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Clair Scan"
toc_hide: true
---
Import JSON reports of Docker image vulnerabilities.
You can import JSON reports of Docker image vulnerabilities found by a Clair scan or the Clair Klar client.

### Sample Scan Data
Sample Clair Scan scans can be found [here](https://github.com/DefectDojo/django-DefectDojo/tree/master/unittests/scans/clair).
9 changes: 0 additions & 9 deletions docs/content/en/integrations/parsers/file/clair_klar.md

This file was deleted.

12 changes: 12 additions & 0 deletions unittests/test_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,15 @@ def test_file_existence(self):
if ".read()" in str(line):
read_true = True
i = 0

def test_parser_existence(self):
for docs in os.scandir(os.path.join(basedir, 'docs', 'content', 'en', 'integrations', 'parsers', 'file')):
if docs.name not in [
'_index.md', 'codeql.md', 'edgescan.md'
]:
with self.subTest(parser=docs.name.split('.md')[0], category='parser'):
parser = os.path.join(basedir, 'dojo', 'tools', f"{docs.name.split('.md')[0]}", "parser.py")
self.assertTrue(
os.path.isfile(parser),
f"Parser '{parser}' is missing or using different name"
)

0 comments on commit c330575

Please sign in to comment.