Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding tarot as a template for the leaflet. #589

Merged
merged 4 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,10 @@
title: "Latest pre-release"
files: |
CHANGELOG.md
LICENSE
LICENSE.md
README.md
creative-commons-attribution-3.0.txt
output/owasp_cornucopia_mobileapp_1.00.zip
output/owasp_cornucopia_mobileapp_1.00_en.zip
output/owasp_cornucopia_webapp_1.22_en.zip
output/owasp_cornucopia_webapp_1.22_es.zip
output/owasp_cornucopia_webapp_1.22_fr.zip
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
run: pipenv run coverage xml
- name: Check test coverage - Report
run: pipenv run coverage report --fail-under 85 scripts/convert*
- name: Generate new output files
- name: Generate new output file
run: |
pipenv run python scripts/convert.py -l all -lt all -t bridge -v 1.22 -e webapp
pipenv run python scripts/convert.py -l all -lt all -t tarot -v 1.22 -e webapp
Expand Down Expand Up @@ -94,11 +94,10 @@
prerelease: false
files: |
CHANGELOG.md
LICENSE
LICENSE.md
README.md
creative-commons-attribution-3.0.txt
output/owasp_cornucopia_mobileapp_1.00.zip
output/owasp_cornucopia_mobileapp_1.00_en.zip
output/owasp_cornucopia_webapp_1.22_en.zip
output/owasp_cornucopia_webapp_1.22_es.zip
output/owasp_cornucopia_webapp_1.22_fr.zip
Expand Down
5 changes: 1 addition & 4 deletions scripts/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def get_mapping_data_for_edition(
"""Get the raw data of the replacement text from correct yaml file"""
data: Dict[Any, Dict[Any, Any]] = {}
logging.debug(
f" --- Starting get_mapping_data_for_edition() for edition: "
" --- Starting get_mapping_data_for_edition() for edition: "
f"{edition} , language: {language} and version: {version} "
f" with mapping to version {get_valid_mapping_for_version(version, edition)}"
)
Expand Down Expand Up @@ -804,9 +804,6 @@ def get_valid_mapping_for_version(version: str, edition: str) -> str:

def get_valid_templates() -> List[str]:
templates = []
if convert_vars.args.layout.lower() in "leaflet":
templates.append("bridge")
return templates
if convert_vars.args.template.lower() == "all":
for template in [t for t in convert_vars.TEMPLATE_CHOICES if t not in ("all", "bridge_qr")]:
templates.append(template)
Expand Down
12 changes: 6 additions & 6 deletions source/webapp-mappings-2.00.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ meta:
languages: ["en", "es", "fr", "nl", "nl", "no-nb", "pt-br"]
suits:
-
name: "Data Validation & Encoding"
name: "DATA VALIDATION & ENCODING"
cards:
-
id: "DV2"
Expand Down Expand Up @@ -108,7 +108,7 @@ suits:
capec: [ 23, 28, 76, 152, 160, 261 ]
safecode: [ 2, 19, 20 ]
-
name: "Authentication"
name: "AUTHENTICATION"
cards:
-
id: "AC2"
Expand Down Expand Up @@ -207,7 +207,7 @@ suits:
capec: [ 115, 207, 554 ]
safecode: [ 14, 28 ]
-
name: "Session Management"
name: "SESSION MANAGEMENT"
cards:
-
id: "SM2"
Expand Down Expand Up @@ -306,7 +306,7 @@ suits:
capec: [ 21 ]
safecode: [ 14, 28 ]
-
name: "Authorization"
name: "AUTHORIZATION"
cards:
-
id: "AZ2"
Expand Down Expand Up @@ -405,7 +405,7 @@ suits:
capec: [ 207, 554 ]
safecode: [ 8, 10, 11 ]
-
name: "Cryptography"
name: "CRYPTOGRAPHY"
cards:
-
id: "CR2"
Expand Down Expand Up @@ -504,7 +504,7 @@ suits:
capec: [ 207, 554 ]
safecode: [ 14, 21, 29 ]
-
name: "Cornucopia"
name: "CORNUCOPIA"
cards:
-
id: "CO2"
Expand Down
4 changes: 2 additions & 2 deletions tests/scripts/convert_utest.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def test_get_valid_style_choices_dynamic(self) -> None:

def test_get_valid_style_choices_blank(self) -> None:
c.convert_vars.args = argparse.Namespace(template="", layout="")
want_template = ["bridge"]
want_template = ["bridge", "tarot"]

got_template = c.get_valid_templates()
self.assertListEqual(want_template, got_template)
Expand All @@ -127,7 +127,7 @@ def test_get_valid_style_choices_all(self) -> None:

def test_get_valid_style_choices_for_leaflet(self) -> None:
c.convert_vars.args = argparse.Namespace(template="all", layout="leaflet")
want_template = ["bridge"]
want_template = ["bridge", "tarot"]

got_template = c.get_valid_templates()
self.assertListEqual(want_template, got_template)
Expand Down
Loading