-
Notifications
You must be signed in to change notification settings - Fork 0
[USER-027][VALI-004] Add login test cases and refine P01_hello.py
#5
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -30,3 +30,6 @@ def login(self, email, password): | |||||
| print(app.login("wrong@test.com", "123")) # Test case 2 | ||||||
| print(app.login("wrong@test.com", "123")) # Test case 3 (locks account) | ||||||
| print(app.login("user@test.com", "Password@123")) # Should fail because account is locked | ||||||
| print("TC4:", app.login("wrong@test.com", "123")) # This will now lock | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I notice a bit of a contradiction in the test logic here. Line 31's comment says it locks the account, and line 32 expects a locked state, but then line 33's comment says 'This will now lock'. This inconsistency makes it unclear what the actual locking threshold is and whether the tests are validating the correct state. We should align the comments and sequence to reflect the intended behavior.
Suggested change
|
||||||
| print("TC5:", app.login("user@test.com", "Password@123")) # Locked account case | ||||||
| print("TC6:", app.login("user@test.com", "Password@123")) # Locked account case | ||||||
|
Comment on lines
+34
to
+35
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcoded Test Credentials I see the issue of hardcoded credentials like Let's move these test credentials out of the code. They should be loaded from a configuration file (e.g.,
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. JAS - Just a suggestion |
||||||
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.
Security/Robustness: Potential ZeroDivisionError
The new division operation uses
base_valueas a divisor. While currently hardcoded to 10, if this logic is later modified to accept dynamic input, it could cause a crash if the divisor is zero.Reasons & Gaps
Reasons
Gaps