Skip to content

Commit

Permalink
Refactor column_titles and masvs_v1_id formatting in populate_dynamic…
Browse files Browse the repository at this point in the history
…_pages.py
  • Loading branch information
cpholguera committed Feb 2, 2024
1 parent 83d4447 commit ac23334
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/scripts/populate_dynamic_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def reorder_dict_keys(original_dict, key_order):

# tests/index.md

column_titles = {'id': 'ID', 'title': 'Name', 'masvs_v2_id': "MASVS v2 ID", 'masvs_v1_id': "MASVS v1 IDs", 'last_updated': 'Last Updated'} #'id': 'ID', ... , 'refs': 'Refs', 'techniques': 'Techniques'
column_titles = {'id': 'ID', 'title': 'Name', 'masvs_v2_id': "MASVS v2 ID", 'masvs_v1_id': "MASVS v1 IDs"} #'id': 'ID', ... , 'refs': 'Refs', 'techniques': 'Techniques', 'last_updated': 'Last Updated'

tests = get_mastg_components_dict("docs/MASTG/tests")
test_types = ["android", "ios"]
Expand All @@ -87,8 +87,8 @@ def reorder_dict_keys(original_dict, key_order):
tests_of_type = [reorder_dict_keys(test, column_titles.keys()) for test in tests if test['platform'] == test_type]
for test in tests_of_type:
test['masvs_v2_id'] = test['masvs_v2_id'][0]
if test.get(masvs_v1_id):
test['masvs_v1_id'] = "\n".join([f"{v1_id}" for v1_id in test['masvs_v1_id']])
if test.get("masvs_v1_id"):
test['masvs_v1_id'] = "<br>".join([f"{v1_id}" for v1_id in test['masvs_v1_id']])


for group_id, checklist in CHECKLIST_DICT.items():
Expand Down

0 comments on commit ac23334

Please sign in to comment.