Skip to content

Commit a05310f

Browse files
committed
Fix cheat sheet parser test expectations on importer branches
1 parent 11236b8 commit a05310f

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

application/tests/cheatsheets_parser_test.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ class Repo:
3434
repo.working_dir = loc
3535
cre = defs.CRE(name="blah", id="223-780")
3636
self.collection.add_cre(cre)
37-
with open(os.path.join(os.path.join(loc, "cheatsheets"), "cs.md"), "w") as mdf:
37+
with open(
38+
os.path.join(
39+
os.path.join(loc, "cheatsheets"),
40+
"Secrets_Management_Cheat_Sheet.md",
41+
),
42+
"w",
43+
) as mdf:
3844
mdf.write(cs)
3945
mock_clone.return_value = repo
4046
entries = cheatsheets_parser.Cheatsheets().parse(
@@ -45,22 +51,26 @@ class Repo:
4551
# verify the external tagging convention, not just enum wiring.
4652
expected = defs.Standard(
4753
name="OWASP Cheat Sheets",
48-
hyperlink="https://github.com/foo/bar/tree/master/cs.md",
54+
hyperlink="https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html",
4955
section="Secrets Management Cheat Sheet",
50-
links=[defs.Link(document=cre, ltype=defs.LinkTypes.LinkedTo)],
56+
links=[
57+
defs.Link(
58+
document=cre, ltype=defs.LinkTypes.AutomaticallyLinkedTo
59+
)
60+
],
5161
tags=[
5262
"family:guidance",
5363
"subtype:cheatsheet",
54-
"source:owasp_cheatsheets",
5564
"audience:developer",
5665
"maturity:stable",
66+
"source:owasp_cheatsheets",
5767
],
5868
)
5969
self.maxDiff = None
6070
for name, nodes in entries.results.items():
6171
self.assertEqual(name, parser.name)
6272
self.assertEqual(len(nodes), 1)
63-
self.assertCountEqual(expected.todict(), nodes[0].todict())
73+
self.assertEqual(expected.todict(), nodes[0].todict())
6474

6575
cheatsheets_md = """ # Secrets Management Cheat Sheet
6676

0 commit comments

Comments
 (0)