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

Feat: add email validation tests to the project and the chapter tests files in the schema. #953

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
13 changes: 13 additions & 0 deletions schema/tests/chapter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@
"['https://example.com/event1', 'https://example.com/event1'] has non-unique elements",
),
("events-null.yaml", "None is not of type 'array'"),
(
"leaders-email-empty.yaml",
"[{'email': '', 'github': 'leader1-github', 'name': 'Leader 1'}] is too short",
),
(
"leaders-email-invalid.yaml",
"[{'email': 'leader1-email@invalid', 'github': 'leader1-github', "
"'name': 'Leader 1'}] is too short",
),
(
"leaders-email-null.yaml",
"[{'email': None, 'github': 'leader1-github', 'name': 'Leader 1'}] is too short",
),
("leaders-empty.yaml", "[] is too short"),
(
"leaders-non-unique.yaml",
Expand Down
10 changes: 10 additions & 0 deletions schema/tests/data/chapter/negative/leaders-email-empty.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
country: India
leaders:
- email: ''
github: leader1-github
name: Leader 1
name: OWASP Chapter
tags:
- chapter-tag-1
- chapter-tag-2
- chapter-tag-3
10 changes: 10 additions & 0 deletions schema/tests/data/chapter/negative/leaders-email-invalid.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
country: India
leaders:
- email: leader1-email@invalid
github: leader1-github
name: Leader 1
name: OWASP Chapter
tags:
- chapter-tag-1
- chapter-tag-2
- chapter-tag-3
10 changes: 10 additions & 0 deletions schema/tests/data/chapter/negative/leaders-email-null.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
country: India
leaders:
- email:
github: leader1-github
name: Leader 1
name: OWASP Chapter
tags:
- chapter-tag-1
- chapter-tag-2
- chapter-tag-3
13 changes: 13 additions & 0 deletions schema/tests/data/project/negative/leaders-email-empty.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
audience: breaker
leaders:
- email: ''
github: leader1-github
name: Leader 1
level: 2
name: OWASP Incubator Code Project
pitch: A very brief, one-line description of your project
tags:
- example-tag-1
- example-tag-2
- example-tag-3
type: code
13 changes: 13 additions & 0 deletions schema/tests/data/project/negative/leaders-email-invalid.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
audience: breaker
leaders:
- email: leader1-email@invalid
github: leader1-github
name: Leader 1
level: 2
name: OWASP Incubator Code Project
pitch: A very brief, one-line description of your project
tags:
- example-tag-1
- example-tag-2
- example-tag-3
type: code
13 changes: 13 additions & 0 deletions schema/tests/data/project/negative/leaders-email-null.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
audience: breaker
leaders:
- email:
github: leader1-github
name: Leader 1
level: 2
name: OWASP Incubator Code Project
pitch: A very brief, one-line description of your project
tags:
- example-tag-1
- example-tag-2
- example-tag-3
type: code
14 changes: 14 additions & 0 deletions schema/tests/project_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@
"['https://example.com/event1', 'https://example.com/event1'] has non-unique elements",
),
("events-null.yaml", "None is not of type 'array'"),
(
"leaders-email-empty.yaml",
"[{'email': '', 'github': 'leader1-github', 'name': 'Leader 1'}] is too short",
),
(
"leaders-email-invalid.yaml",
"[{'email': 'leader1-email@invalid', "
"'github': 'leader1-github', "
"'name': 'Leader 1'}] is too short",
),
(
"leaders-email-null.yaml",
"[{'email': None, 'github': 'leader1-github', 'name': 'Leader 1'}] is too short",
),
("leaders-empty.yaml", "[] is too short"),
(
"leaders-non-unique.yaml",
Expand Down