Skip to content

Commit

Permalink
Add more funding policy compliance check test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
arkid15r committed Sep 5, 2024
1 parent 92057bc commit b03f9e5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions backend/apps/github/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ def check_owasp_site_repository(key):

def check_funding_policy_compliance(platform, target):
"""Check OWASP funding policy compliance."""
if not target:
return True

if platform == "github":
return target.lower() == "owasp"
if platform == "custom":
Expand Down
5 changes: 4 additions & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ addopts = [
"--no-cov-on-fail",
"--numprocesses=auto",
]
filterwarnings = ["ignore::DeprecationWarning:xdist"]
filterwarnings = [
"ignore::DeprecationWarning:pytest_cov",
"ignore::DeprecationWarning:xdist",
]
log_level = "INFO"
python_files = ["*_tests.py"]

Expand Down
5 changes: 5 additions & 0 deletions backend/tests/github/utils_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@
("custom", "https://owasp.org/donate", True),
("github", "owasp", True),
("github", "OWASP", True),
("patreon", "", True),
("patreon", None, True),
# Non-compliant
("custom", "https://my-site.com/donate", False),
("custom", "https://my-site.com/owasp/donate", False),
("patreon", "username", False),
],
)
def test_check_funding_policy_compliance(platform, target, as_expected):
Expand Down

0 comments on commit b03f9e5

Please sign in to comment.