Skip to content

CS50p Wk 7 Working - Test for times with leading zeros #328

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

Merged
merged 6 commits into from
Jun 27, 2025

Conversation

bxngyn
Copy link
Contributor

@bxngyn bxngyn commented Jun 27, 2025

Related to issue #231.

The current testing script allows for times like 009 AM to 5 PM or 9:01 AM to 5:0008 PM. We should make the testing script stricter since the assignment instruction specifically states that the four, 12-hour time formats the function expects are

  • 9:00 AM to 5:00 PM
  • 9 AM to 5 PM
  • 9:00 AM to 5 PM
  • 9 AM to 5:00 PM

The instruction does not say we can assume the time inputted will fall within these 4 formats, so we should edit the testing script to account for this leading zero case.

@bxngyn bxngyn requested a review from rongxin-liu June 27, 2025 15:06
@bxngyn
Copy link
Contributor Author

bxngyn commented Jun 27, 2025

Note: This change causes the test_correct() check to fail since the current correct working.py file (correct_test.pyc) does not currently raise a ValueError for leading zero times. Currently working on this and will open a PR once resolved.

@rongxin-liu rongxin-liu added the CS50P CS50 Python label Jun 27, 2025
Copy link
Contributor

@rongxin-liu rongxin-liu left a comment

Choose a reason for hiding this comment

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

Looks good! Merging!

@rongxin-liu
Copy link
Contributor

Fixes #231

@rongxin-liu rongxin-liu merged commit 0d05f55 into 2022/python Jun 27, 2025
@rongxin-liu rongxin-liu deleted the CS50p-Working-Accepts-Leading-Zeros branch June 27, 2025 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CS50P CS50 Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants