-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from CS222-UIUC/aden/userpagetouchup
return json in userpage() and fix userpage test
- Loading branch information
Showing
11 changed files
with
204 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""Tests password, email, and phone""" | ||
import re | ||
|
||
|
||
def validate_password(password: str) -> bool: | ||
"""Used in Login and User class""" | ||
return len(password) >= 8 | ||
|
||
|
||
def validate_email(email: str) -> bool: | ||
"""Used in Login and User class""" | ||
regex_email = re.compile(r"\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b") | ||
return regex_email.fullmatch(email) | ||
|
||
|
||
def validate_phone(phone: str) -> bool: | ||
"""Used in Login and User class""" | ||
regex_phone = re.compile( | ||
r"^\s*(?:\+?(\d{1,3}))?[-. (]" | ||
r"*(\d{3})[-. )]*(\d{3})[-. ]" | ||
r"*(\d{4})(?: *x(\d+))?\s*$" | ||
) | ||
return regex_phone.fullmatch(phone) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
1e12232
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage Report
1e12232
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage Report
1e12232
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage Report