Skip to content

Commit

Permalink
touch up
Browse files Browse the repository at this point in the history
  • Loading branch information
akrakman committed Nov 18, 2022
1 parent 026c1c5 commit a9466d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
Binary file modified src/backend/database/database_test.db
Binary file not shown.
19 changes: 8 additions & 11 deletions src/backend/tests/test_userpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ class TestUserPage:

username = "test_username"
phone = "012-345-6789"
invalid_phone = "123-3421-322"
password = "newpassword1234"
invalid_password = "inv2341"
email = "[email protected]"
invalid_email = "testemail@"
userpage = None
main_page_staging = MainPageStaging()

Expand All @@ -41,6 +38,14 @@ def insert_users(self, cursor: sqlite3.Cursor, connection: sqlite3.Connection):
)
connection.commit()

@use_test
def test_invalid_input(self):
"""invalid input returns False"""
self.initialize()
assert self.userpage.update_password("inv2341") is False
assert self.userpage.update_email("testemail@") is False
assert self.userpage.update_phone("123-3421-322") is False

@use_test
def test_get_user(self):
"""get_user returns correct Use"""
Expand Down Expand Up @@ -86,14 +91,6 @@ def test_valid_email(self):
self.cleanup_db()
assert test_result == self.email

@use_test
def test_invalid_input(self):
"""invalid input returns False"""
self.initialize()
assert self.userpage.update_password(self.invalid_password) is False
assert self.userpage.update_email(self.invalid_email) is False
assert self.userpage.update_phone(self.invalid_phone) is False

@use_test
def test_valid_phone(self):
"""update_phone returns True and db entry is correct"""
Expand Down

3 comments on commit a9466d2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCover
app.py1320100%
config.py10100%
decorators.py270100%
dataholders
   apt.py90100%
   mainpage_get.py150100%
   review.py70100%
   user.py80100%
pages
   login.py370100%
   mainpage.py1000100%
   userpage.py540100%
TOTAL3900100%

Tests Skipped Failures Errors Time
47 0 💤 0 ❌ 0 🔥 0.930s ⏱️

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCover
app.py1320100%
config.py10100%
decorators.py270100%
dataholders
   apt.py90100%
   mainpage_get.py150100%
   review.py70100%
   user.py80100%
pages
   login.py370100%
   mainpage.py1000100%
   userpage.py540100%
TOTAL3900100%

Tests Skipped Failures Errors Time
47 0 💤 0 ❌ 0 🔥 0.853s ⏱️

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCover
app.py1320100%
config.py10100%
decorators.py270100%
dataholders
   apt.py90100%
   mainpage_get.py150100%
   review.py70100%
   user.py80100%
pages
   login.py370100%
   mainpage.py1000100%
   userpage.py540100%
TOTAL3900100%

Tests Skipped Failures Errors Time
47 0 💤 0 ❌ 0 🔥 1.140s ⏱️

Please sign in to comment.